We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Checkbox control

Hi, I am trying to add cell of type check box to my databound grid but i am facing some problems: 1. I had assosiated DataTable to grid. I am trying to change checkbox state by specifing true or false for checkbox column but there is no change in checkbox state. 2. I am not able to check or uncheck checkbox. Do i have to handle the click event and change the state of control in my code? Thanks -Rajiv DatabasedAlarmUI_8751.zip

1 Reply

Administrator March 15, 2004 09:13 AM UTC

If your properties are strictly column properties, then you should not be using PrepareViewStyleInfo to set them. Instead, you should just set then once in either grid.Binder.InternalColumns[colIndex].StyleInfo (if you have not explicitly added GridBoundColumsn), or grid.GridBoundColulms[colindex].StyleInfo (if you have added them). The reason is that PrepareViewStyleInfo is hit many, many times. If you can avoid using it, you should. Another reason is that PrepareViewStyleInfo should be used only to set visual drawing type properties such as BackColor or Font or ???. There are some behaviorial type properties such as ReadOnly and Enabled where setting them in PrepareViewStyleinfo is too late as PrepareViewStyleInfo has not been hit when the grid needs use of these properties. For such properties, they should be set in Model.QueryCellInfo instead of PrepareViewStyleInfo. (I suspect this is why you code is not working as expected).
Loader.
Live Chat Icon For mobile
Up arrow icon