CB
Clay Burch
Syncfusion Team
May 2, 2002 10:57 AM UTC
You can do this by deriving a columnstyle and overriding the Edit method, and somehow deciding whether to call the baseclass or not. Not calling the baseclass will make the cell unable to go into edit mode. Exactly how you decide whether to call the baseclass or not is your choice. You can get the datagrid object by referencing the TableStyle.DataGrid member of the columnstyle.
A more elegant way might be to add an event to your derived columnstyle, and let the user add an event handler to determine whether a cell should be enabled on a cell by cell basis. This FAQ has a sample of this technique.
George Shepherd's Windows Forms FAQ contains an entry entitled:
How can I prevent a particular cell from being editable?
Check it out at:
http://www.syncfusion.com/faq/windowsforms/search/758.aspx