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:

92796 Feb 4,2010 10:20 AM UTC Feb 9,2010 08:34 AM UTC Windows Forms 3
loading
Tags: GridControl
Arseny Khutoriansky
Asked On February 4, 2010 10:20 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.

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

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 06:33 AM UTC

Thanks

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

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.

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

;