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
close icon

regarding dynamically setting the cells as read only...

Hi,
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

1 Reply

AD Administrator Syncfusion Team 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,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon