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.

griddataboundgrid, setting cells read only based on their content

Thread ID:

Created:

Updated:

Platform:

Replies:

15181 Jun 14,2004 04:40 AM May 24,2005 12:23 PM Windows Forms 5
loading
Tags: GridControl
Lucas Tijssen
Asked On June 14, 2004 04:40 AM

hello, can somebody help me, I have a gdbg based on a dataview. Based on the contents of a cell I want to set the row to read only kindly regards

Administrator [Syncfusion]
Replied On June 14, 2004 04:47 AM

You should do this in Model.QueryCellInfo. Check out this KB. http://www.syncfusion.com/Support/article.aspx?id=10351 If you want cell 2,2 to be readonly if it holds the string "bad", then you could use this if statement. if(e.RowIndex == 2 && e.ColIndex == 2 && e.Style.Text == "bad") e.Style.ReadOnly = true;

Lucas Tijssen
Replied On June 14, 2004 05:23 AM

>You should do this in Model.QueryCellInfo. Check out this KB. > >http://www.syncfusion.com/Support/article.aspx?id=10351 > >If you want cell 2,2 to be readonly if it holds the string "bad", then you could use this if statement. > ok thank you, but how do I set the row read only ? > >if(e.RowIndex == 2 && e.ColIndex == 2 && e.Style.Text == "bad") >e.Style.ReadOnly = true; >

Administrator [Syncfusion]
Replied On June 14, 2004 05:34 AM

You could use code like this for the if-statement in QueryCellInfo.
if(e.RowIndex == 2 && e.ColIndex > 0)
{
	//set row 2 readonly if col 1 is ''bad''
	string s = (e.ColIndex == 1) ? e.Style.Text : this.grid[e.RowIndex, e.ColIndex].Text;
	if( s == "bad")
     		e.Style.ReadOnly = true;
}
The point is to get the test value from the style object when the text value cell is being requested, but when some other cell is being requested, you get the test value from the grid.

Prof DISSOU Jamâl-Dine
Replied On May 24, 2005 10:30 AM

>You could use code like this for the if-statement in QueryCellInfo. > >
>if(e.RowIndex == 2 && e.ColIndex > 0)
>{
>	//set row 2 readonly if col 1 is ''bad''
>	string s = (e.ColIndex == 1) ? e.Style.Text : this.grid[e.RowIndex, e.ColIndex].Text;
>	if( s == "bad")
>     		e.Style.ReadOnly = true;
>}
>
> >The point is to get the test value from the style object when the text value cell is being requested, but when some other cell is being requested, you get the test value from the grid. What is the equivalent for GridGroupingControl ? Jamâl-Dine DISSOU

Administrator [Syncfusion]
Replied On May 24, 2005 12:23 PM

QueryCellStyleInfo.

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.

;