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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





212 May 2,2002 02:50 AM UTC May 2,2002 10:57 AM UTC WinForms 1
Tags: FAQ
Administrator [Syncfusion]
Asked On May 2, 2002 02:50 AM UTC

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

Clay Burch [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon