Is there any way to alternate the color of rows in a databound checkboxlist??? I have googled this for quite some time and am unable to come up with anything helpful....
I have three checkboxlists and I want to alternate the row color in each checkboxlist with white and grey. Suggestions?! Any help would be greatly appreciated!!!!
That code works! :) EXCEPT, one more thing - how do I get the color to extend the full length of the row, not just the length of the text in that particular row?
You can only change the color of CheckBoxList in the place of itself. The whole row you mean I guess it is not the part of CheckBoxList, so you cannot change it with setting anything in CheckBoxList. You can use CheckBox in a Repeater or DataList, then bind
it and set the style to the Item in Repeater or DataList as a workaround.
lmm2
Member
22 Points
9 Posts
databound checkboxlist - alternating row color
Mar 28, 2011 03:53 PM|LINK
Is there any way to alternate the color of rows in a databound checkboxlist??? I have googled this for quite some time and am unable to come up with anything helpful....
I have three checkboxlists and I want to alternate the row color in each checkboxlist with white and grey. Suggestions?! Any help would be greatly appreciated!!!!
databind checkboxlist asp.net
sansan
All-Star
53942 Points
8147 Posts
Re: databound checkboxlist - alternating row color
Mar 28, 2011 04:47 PM|LINK
You can add background color attribute for the ListItem
databind checkboxlist asp.net
lmm2
Member
22 Points
9 Posts
Re: databound checkboxlist - alternating row color
Mar 28, 2011 05:43 PM|LINK
That code works! :) EXCEPT, one more thing - how do I get the color to extend the full length of the row, not just the length of the text in that particular row?
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: databound checkboxlist - alternating row color
Mar 30, 2011 08:38 AM|LINK
Hi,
You can only change the color of CheckBoxList in the place of itself. The whole row you mean I guess it is not the part of CheckBoxList, so you cannot change it with setting anything in CheckBoxList. You can use CheckBox in a Repeater or DataList, then bind it and set the style to the Item in Repeater or DataList as a workaround.
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework