This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to create listbox items programatically and have been so far completely unable to set the back color of the listbox items or to turn the borders on for all listboxitems. Please help.
// Method to set default ListItem properties |
private RadListBoxItem newListItem(string displayText, int ID, GMapMarker marker) |
{ |
RadListBoxItem item = new RadListBoxItem(); |
item.ImageAlignment = ContentAlignment.MiddleLeft; |
item.TextImageRelation = TextImageRelation.ImageBeforeText; |
if (marker is JobMarker) |
{ |
item.Image = (Image)Properties.Resources.ResourceManager.GetObject(((JobMarker)marker).IconFileName); |
if (!((JobMarker)marker).IsGeoCoded) |
item.BackColor = Color.LightPink; |
} |
else if (marker is EmployeeMarker) |
{ |
item.Image = (Image)Properties.Resources.ResourceManager.GetObject(((EmployeeMarker)marker).IconFileName); |
if (!((EmployeeMarker)marker).isGeoCoded) |
{ |
item.BackColor = Color.LightPink; |
} |
} |
item.Text = displayText; |
item.Tag = ID; |
return item; |
} |
This is the code I am using to create the listboxitem