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.

Disabling a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

57699 Mar 8,2007 03:08 PM Mar 9,2007 03:44 PM Windows Forms 3
loading
Tags: GridControl
dinesh upreti
Asked On March 8, 2007 03:08 PM

How do i disable a specific cell or change its colour in grid gruopuing control.
I am using QueryCellStyleInfo event but could not figure out how?

Administrator [Syncfusion]
Replied On March 8, 2007 03:52 PM

Hi Dinesh,

You can try this code to disable the cell(5,1) in a grid.

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.Style.CellIdentity.RowIndex == 5 && e.Style.CellIdentity.ColIndex == 1)
{
e.Style.Enabled = false;
e.Style.BackColor = SystemColors.Control;
}
}

Best regards,
Haneef

dinesh upreti
Replied On March 9, 2007 05:15 AM

Thanks,
Another problem is that i want to access the columns via their name and not index. If you could help me on that, it would be great.


>Hi Dinesh,

You can try this code to disable the cell(5,1) in a grid.

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.Style.CellIdentity.RowIndex == 5 && e.Style.CellIdentity.ColIndex == 1)
{
e.Style.Enabled = false;
e.Style.BackColor = SystemColors.Control;
}
}

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 9, 2007 03:44 PM

Hi Dinesh,

You can try this.

//QueryCellInfo event.
GridColumnDescriptor column = e.TableCellIdentity.Table.TableDescriptor.Columns["ColumnName"] as GridColumnDescriptor;

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.

;