private void GroupedColumns_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e) { if (this.gridGroupingControl1.TableDescriptor.GroupedColumns.Count >= 1) { foreach (Element el in this.gridGroupingControl1.Table.DisplayElements) { if (!(el is GridRecordRow)) { int row = this.gridGroupingControl1.Table.NestedDisplayElements.IndexOf(el); if (this.gridGroupingControl1.Table.NestedDisplayElements[row].IsCaption()) { GridCaptionRow crow = (GridCaptionRow)el; Group gp = crow.ParentGroup; if (gp.IsExpanded) { crow.Appearance.GroupCaptionPlusMinusCell.CellValue = Image.FromFile(Syncfusion.Windows.Forms.WinFormsUtils.FindFile("res", "minus.png")); } else { crow.Appearance.GroupCaptionPlusMinusCell.CellValue = Image.FromFile(Syncfusion.Windows.Forms.WinFormsUtils.FindFile("res", "plus.png")); } } } } } }
private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e) { if (e.Inner.MouseEventArgs.Button == MouseButtons.Left) { if (e.Inner.RowIndex > 1) { GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex); if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell) { GridCaptionRow curGrp = e.TableControl.Table.NestedDisplayElements[e.Inner.RowIndex] as GridCaptionRow; curGrp.ParentGroup.IsExpanded = !curGrp.ParentGroup.IsExpanded; } } } }
private void gridGroupingControl1_GroupExpanded(object sender, GroupEventArgs e) { GridCaptionRow gcr = (GridCaptionRow)e.Group.Caption.CaptionRows[0]; gcr.Appearance.GroupCaptionPlusMinusCell.CellValue = Image.FromFile(Syncfusion.Windows.Forms.WinFormsUtils.FindFile("res", "minus.png")); }