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

How do you prevent a readonly datagrid column from being selected

I have a Datagrid with several ReadOnly columns. The problem is that I am still able to click in the columns. I can't change anything, but I need to be able to disable the ability to even click in the columns.

Basically, it should be as if the datagrid is set Enabled=False, but only for specific columns.

Is there a way to do this?

1 Reply

HA haneefm Syncfusion Team October 25, 2007 08:42 PM UTC

Hi Chad,

Try setting the Clickable and Enabled property of the GridStyleInfo object to False in a readonly grid cell. Here are the codes that shows this task

For GridControl :
>>>>>>>>>>>>>>
this.grid.ColStyles[1].Clickable = false;
this.grid.ColStyles[1].Enabled =false;

For GridDataBoundGrid:
>>>>>>>>>>>>>>>>>>>>
this.grid.Binder.InternalColumns[1].StyleInfo.Clickable = false;
this.grid.Binder.InternalColumns[1].Enabled =false;

For GroupingGrid :
>>>>>>>>>>>>>>>>
this.grid.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.Clickable = false;
this.grid.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.Enabled =false;

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon