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

Making a particular cell in data grid control making enabled/disabled in windows c# programming

How to make a particular cell OF A DATAGRID CONTROL IN wINDOWS C# PROGRAMMING (depending upon the value of a cell in a particular column and a particular row ) making enabled or disabled. Thanks

1 Reply

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

Live Chat Icon For mobile
Up arrow icon