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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

regarding dynamically setting the cells as read only...

Thread ID:





51795 Nov 14,2006 12:52 PM UTC Nov 15,2006 06:13 AM UTC WinForms 1
Tags: GridControl
Manpreet Saini
Asked On November 14, 2006 12:52 PM UTC

I am using a data bound grid. In two of its columns i have to dynamically made some cells as readonly. i am using ...
Qualification.SetReadonlyCell(rowindex,colindex, True)
But after setting them read only they do not allow the mouse to make them focused.
While if i am making the whole column as read only then all cells of that column allow the mouse to focus them.
I want those dynamically read only cells to allow the mouse to focus on them.
Please suggest.

Thanks and Regards,
Manpreet Saini

Administrator [Syncfusion]
Replied On November 15, 2006 06:13 AM UTC

Hi Manpreet,

You can handle the Model.QueryCellInfo event and set the Style.Readonly property to "true" for readonly cells. Here is a code snippet.

private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
if( e.RowIndex % 2 == 0
&&( e.ColIndex == 2 || e.ColIndex == 3))
e.Style.ReadOnly = true;
e.Style.BackColor = Color.AliceBlue;

Sample : http://www.syncfusion.com/Support/user/uploads/GDBGReadOnly_f50247c8.zip

Best Regards,


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

or the page will be automatically redirected to 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