QueryCellStyleInfo is not called for grouped tables

I have a grouping grid, and I'd like to apply custom formatting to the cells. It works for the table when no grouping is done. As soon as any grouping is applied - all the columns in the resulting sub-tables are not styled. The event handler is not even called for them.

Do I have to assign a delegate to those groups during binding or is there some option to cascade that delegate to all sub-tables in the grid?

Thank you.

2 Replies

VS Vasili Sviridov June 26, 2009 12:55 AM UTC



my delegate assignment did not happen after postback - hence no rendering



RP Rekha P Syncfusion Team June 26, 2009 01:48 PM UTC

Hi Vasili,

Thank you for your interest in Essential Grid.

Please find a simple sample illustrating the event triggering of QueryCellStyleInfo with the grouped tables and the reported issue may cause due enabling the QueryCellStyleInfo event within !IsPostBack condition.

Code Snippet:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.GridGroupingControl1.DataSource = GetData();
}
this.GridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(GridGroupingControl1_QueryCellStyleInfo);
}

void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell ||
e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell ||
e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
{
e.Style.Borders.All = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.DashDotDot, Color.Blue);
e.Style.TextColor = Color.Brown;
e.Handled = true;
}
}


http://files.syncfusion.com/support/GGC.Web/7.2.0.37/F83577/main.htm

In the above sample, the cell text color and its border style will be sustained through grouped columns. Please let me know if this solves your issue or could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Rekha

Loader.
Up arrow icon