Hello,
I have a situation where I need to databind a string array to a CheckBoxList
. The decision if each item should be checked, or not, needs to be done by using a different string array. Here's a code sample:
string[] supportedTransports = ... ;// "sms,tcp,http,direct"
string[] transports = ... ; // subset of the above, i.e. "sms,http"
// bind supportedTransports to the CheckBoxList
TransportsCheckBoxList.DataSource = supportedTransports;
TransportsCheckBoxList.DataBind();
This binds nicely, but each item is unchecked. I need to query transports
, somehow, to determine the checked status. I am wondering if there is an easy way to do this with CheckBoxList
or if I have to create some kind of adapter and bind to that?
Thanks in advance!