User2041710445 posted
Dear All, How can I change the listed items forecolor, font, and so on generated by using an "ObjectList" in VB.NET ? What I already tried ... During "onItemDataBind"
<Mobile:ObjectList id="ObjectList1" runat="server" onItemDatabind="On_ItemDataBind"> <Field title="Name" name="artcod" datafield="artcod"></Field> </Mobile:ObjectList> Sub On_ItemDataBind(ByVal sender As Object, ByVal e As ObjectListDataBindEventArgs)
If e.ListItem.Item("artcod") = "0" Then e.ListItem.ForeColor = System.Drawing.Color.FromName("#FF0000") '--red color '--- or e.ListItem.ForeColor = System.Drawing.Color.Red End if End sub
Above does'not work, without any error! This works, for the whole objectlist.
ObjectList1.ForeColor = System.Drawing.Color.FromName("#FF0000") I need only to change one item. If someone knows and can help me, thanks in advance, AnCo
User-1483006097 posted
Seriously, I'm having the same problem too. I'm using similar code to what AnCo wrote - and it looks pretty straight forward. Does anyone have any idea why this doesn't work? Any suggestions to a work around? Thanks.