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.
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.