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

regarding dynamically setting the cells as read only...

Thread ID:

Created:

Updated:

Platform:

Replies:

51795 Nov 14,2006 07:52 AM Nov 15,2006 01:13 AM Windows Forms 1
loading
Tags: GridControl
Manpreet Saini
Asked On November 14, 2006 07:52 AM

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

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

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

CONFIRMATION

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.

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.

;