CheckboxList inside a usercontrol inside of a datalist.

G

Guest

I'm almost certain this is a bug, or atleast "undesirable behavior".

I felt the checkbox list control had shortcomings so I ventured on creating
my own checkbox list user control. To put it shortly, the usercontrol had a
checkbox list inside of it, that would be bound by a datasource that was to
be specified as a property of the control. It also had an all checkbox at the
top that would select all of the checkboxes in the list...
The problem came with the property I added to the control SelectedItems.
This property was to be set after the Items property was set and the checkbox
list was databound to it. Then the selectedItem property was set and the
selected items would be checked. <--- That is where the buggy behavior came
in.

From my tests, it appears that if you use databinding on a checkbox list or
datalist with checkboxes as items, inside of a usercontrol and put that
usercontrol inside of a datagrid as an item, and try to check those
checkboxes in code - IT WILL NOT WORK.

I know it sounds crazy but I learned the hard way. I will post code soon to
show you. For now, just let me know if it rings a bell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top