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.

GGC, cell enabling/disabling

Thread ID:

Created:

Updated:

Platform:

Replies:

92796 Feb 4,2010 05:20 AM Feb 9,2010 03:34 AM Windows Forms 3
loading
Tags: GridControl
Arseny Khutoriansky
Asked On February 4, 2010 05:20 AM

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.

Jisha Joy [Syncfusion]
Replied On February 5, 2010 01:49 AM

Hi Arseniy,

You could achieve the desired behavior by handling the QueryCellStyleInfo event. In this event you could set the styles of required cells based on the conditions.



void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "VAL")
{
Record r = e.TableCellIdentity.DisplayElement.GetRecord();
if (r != null)
{
if ((bool)r.GetValue("FLAG") == false)
{
e.Style.Enabled = false;

}

}
}

}
}




Please let me know if this helps.

Regards,
Jisha

Arseny Khutoriansky
Replied On February 9, 2010 01:33 AM

Thanks

Jisha Joy [Syncfusion]
Replied On February 9, 2010 03:34 AM

Hi Arseniy,

Thank you for your update.

Thanks,
Jisha

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.

;