private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if( e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell
&& e.TableCellIdentity.GroupedColumn != null &&
e.TableCellIdentity.GroupedColumn.Name == "Customer" )
{
GridCaptionRow captionRow = e.TableCellIdentity.DisplayElement as GridCaptionRow;
GridCaptionSection captionSection = captionRow.ParentSection as GridCaptionSection;
e.Style.Text = "Country: " + captionRow.ParentGroup.ParentGroup.Category + "Customer: " + captionRow.ParentGroup.Category;
}
}
But let me know if I misunderstood.
Stefan
private void checkBox7_CheckedChanged(object sender, System.EventArgs e)
{
gridGroupingControl3.TableModel.CoveredRanges.Clear();
if (checkBox7.Checked)
{
gridGroupingControl3.TableDescriptor.Columns[POSITION].HeaderText = "2219 ADG AHIT";
this.gridGroupingControl3.TableModel.QueryCoveredRange +=
new Syncfusion.Windows.Forms.Grid.GridQueryCoveredRangeEventHandler(TableModel_QueryCoveredRange);
}
else
{
this.gridGroupingControl3.TableModel.QueryCoveredRange -=
new Syncfusion.Windows.Forms.Grid.GridQueryCoveredRangeEventHandler(TableModel_QueryCoveredRange);
}
gridGroupingControl3.Refresh();
}
private void TableModel_QueryCoveredRange(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCoveredRangeEventArgs e)
{
GridTableModel tm = sender as GridTableModel;
Element el = tm.Table.DisplayElements[e.RowIndex];
if (el is CaptionRow)
{
GridTableCellStyleInfo style = tm[e.RowIndex, e.ColIndex];
int maxCaptionColCount = Math.Max(tm.Table.TableDescriptor.GetColumnIndentCount(), tm.Table.TableDescriptor.GetColCount()-1);
int startCol = el.GroupLevel+1;
maxCaptionColCount = Math.Min(5+1, maxCaptionColCount);
IGridGroupOptionsSource g = el.ParentGroup as IGridGroupOptionsSource;
if (g != null && !g.GroupOptions.ShowCaptionPlusMinus)
{
startCol--;
}
int d = (el.ParentTable.RelatedTables.Count > 0) ? 1 : 0;
if (!((GridTable) el.ParentTable).TableOptions.ShowRecordPlusMinus)
d = 0;
if (e.ColIndex >= startCol && e.ColIndex <= maxCaptionColCount)
{
e.Range = GridRangeInfo.Cells(e.RowIndex, startCol, e.RowIndex, maxCaptionColCount);
e.Handled = true;
}
}
}
Stefan