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

"gray" a checkbox in runtime

hi gurus, I want to add to a grid certain columns of checkBox Cell-Type. Some cells have to be left unchecked and "gray"ed so that users cannot edit it. These cells are determined at run-time. Is GridControl a must? Pls give some advice. Thanks! Rebecca

3 Replies

AD Administrator Syncfusion Team December 21, 2004 08:10 AM UTC

To make the textbox disabled, you can set the style.Enabled = false for the cell. If you want to do this in a GridDataBoundGrid (on a cell by cell basis), then you shoul duse the grid.Model.QueryCellInfo to handle this. Here is a KB link that discusses doing something similar for ReadOnly cells.

RE Rebecca December 22, 2004 01:24 AM UTC

Thanks a lot. It works. However, I have many columns and rows in the grid and it is very time-consuming. When should I add this event since I have to hide/add/remove columns and rows at run-time.

AD Administrator Syncfusion Team December 22, 2004 07:14 AM UTC

I am not sure I understand your question. You would normally add the event in say Form.Load. Your code in QueryCellInfo would have to use a criteria that did not depend upon information that would be compromised by runtime moving/hiding columns. So, exactly what determines whether the CheckBox is enable or not? You would have to implement the criteria in a general manner. If you explain how you are determining whether the checknbox is enabled or not, then maybe we could suggest something.

Live Chat Icon For mobile
Up arrow icon