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.
Syncfusion Feedback

GGC, cell enabling/disabling

Thread ID:

Created:

Updated:

Platform:

Replies:

92791 Feb 4,2010 09:29 AM UTC Feb 5,2010 10:40 AM UTC ASP.NET Web Forms (Classic) 2
loading
Tags: GridGroupingControl
Arseny Khutoriansky
Asked On February 4, 2010 09:29 AM UTC

Hi,

I have table with 3 columns: ID(int), FLAG(bit) and VAL(string)
Column Flag is displayed as CheckBox automaticaly, because it is bit-type.


And I want that in each row cell of column VAL will be enabled, if the FLAG-cell is cheked(in this row) and
disabled, if the FLAG-cell is unchecked.

Please, give me some solution for this issue.

Thanks.

Arseny Khutoriansky
Replied On February 4, 2010 10:22 AM UTC

Sorry, the post for WinForms

Ranjeet Kumar [Syncfusion]
Replied On February 5, 2010 10:40 AM UTC

Hi Arseniy,

Thanks for your interest in Syncfusion Products.

The sample attached contains a GridGroupingControl with three columns ID(int), FLAG(Boolean) and VAL(string) respectively. Column FLAG is of type CheckBox. To enable or disable VAL column's cell based on the checkbox state, I have handled QueryCellStyleInfo event as shown below in the code snippets.

To test the sample, run the sample and check or uncheck the checkbox and click on the corresponding cell of VAL Column.


// Event :

// Occurs for each cell before GridTableControl starts painting and lets users customize the display of cells.
this.gridGroupingControl1.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);

// Handler :

// To enable or disable VAL column cell
if (e.TableCellIdentity.ColIndex == 3)
{
// element displayed at the row of this cell
Element el = e.Style.TableCellIdentity.DisplayElement;
if (el != null && el.Kind == DisplayElementKind.Record)
{
// represents a record with data
Record r = el.GetRecord();
if (r == null)
return;

string st = r.GetValue("FLAG").ToString();

if (st.Equals("False"))
{
e.Style.Enabled = false;
}
}
}

Please find the sample attached from link mentioned below :

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F92791-1051601063.zip

Regards,
Ranjeet.

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.

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

;