Following scenario: I create a CheckBoxList in my Page_Load (inside (!Page.IsPostBack)), then load some data in my business logic using LINQ. The data produced is a List with different Value and Text properties, which is fine in the moment I call the method (as I checked the return variable with the debugger).
Now as soon as the List object is assigned as the DataSource of my CheckBoxList, using the debugger i realized that the CheckBoxList.Items have overwritten the Item.Value property with the Item.Text property.
So, my desired (and produced) List contains following item, for example:

However, after DataBind() of my CheckBoxList, this is what the Items look like in the Items collection:

Is there a clean solution for this problem? My further interest is to compare the Items (found by value) with another list of items (actually the SELECTED items; i thought that giving the CheckBoxList a List of ListItems with the Item.Selected property would be the cleanest way to do it.. nope).
Thanks in advance for any suggestions!
DataValueFieldandDataTextFieldproperties of yourCheckBoxListso it knows which fields/properties in your datasource to map to the value and text properties? - Ben RobinsonListItem'sTextreturns theValueif it isnull. The same applies to theValueproperty which returns theTextif it'snull. stackoverflow.com/questions/15396385/… In this case it seems that there's only theText. So you should provide the code instead of images, then we can try to fix it. - Tim SchmelterValueis overwritten byTextif theValueisnulland theTextis not and vice versa. - Tim Schmelter