void myGrid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if ((e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentICell) ||
(e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentLCell) ||
(e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentTCell))
{
if (myGrid.TableDescriptor.GroupedColumns.Count > 1)
e.Style.BackColor = SystemColors.Window;
}
}
void myGrid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if ((e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentICell) ||
(e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentLCell) ||
(e.TableCellIdentity.TableCellType == GridTableCellType.GroupIndentTCell))
{
if (myGrid.TableDescriptor.GroupedColumns.Count > 1)
e.Style.BackColor = SystemColors.Window;
}
}
void myGrid_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
if (e.TableControl.TableDescriptor.GroupedColumns.Count > 0)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.Inner.Style;
string firstColname = e.TableControl.TableDescriptor.VisibleColumns[0].Name;
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
&& style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == firstColname)
{
style.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(GridBorderStyle.Solid, groupBorderColor, GridBorderWeight.Thick);
}
}
}
void myGrid_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
if (e.TableControl.TableDescriptor.GroupedColumns.Count > 0)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.Inner.Style;
string firstColname = e.TableControl.TableDescriptor.VisibleColumns[0].Name;
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
&& style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == firstColname)
{
style.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(GridBorderStyle.Solid, groupBorderColor, GridBorderWeight.Thick);
}
}
}
Thanks for the help. That got me closer. However, simply setting the style like you suggest doesn't really give the "outlook" style grouping look like you have in your outlook sample.
I'm after the specific look of the outlook grouping example where the heading for each group is just a title with an underline. Setting the style the way you have it here still leaves me with the same old column headers for each group. If you look at the outlook sample and look at at the heading for each group, you'll see what I'm getting at.
There must be some combination of visual styles and other properties that achieve this specific look. I've looked though the outlook example and I just can't find where that aspect of the GGC gets configured to look that way.
Thanks again.
>Hi Tod,
The VisualStyles can be applied to the GridGroupingControl through the GridVisualStyles property. The below code sets the Office2007Blue skin to the grid. You could also do the same in the design time accesing the tag.
this.gridGroupingControl1.TableOptions.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Office2007Blue;
Thanks for your interest in Syncfusion Products.
Have a nice time.
Regards,
Rajagopal
Open Outlook. In the View tab at the top of the screen, check the Show as Conversations box. This will group together emails by conversation. You can play around with the Conversation Settings to find what works best for you.
Regards,
Peter