|
this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
//Display the GroupFooter cell
this.gridGroupingControl1.TopLevelGroupOptions.ShowGroupFooter = true;
//Set the caption text to be displayed
CaptionText = this.gridGroupingControl1.TableDescriptor.Name + ":" + this.gridGroupingControl1.Table.Records.Count + " Items";
this.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellValue = CaptionText;
//Disable the editing
this.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellType = GridCellTypeName.Static;
//Set the height of the GroupCaption
this.gridGroupingControl1.TableOptions.GroupFooterSectionHeight = 20;
this.gridGroupingControl1.SourceListListChanged += GridGroupingControl1_SourceListListChanged;
private void GridGroupingControl1_SourceListListChanged(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
{
//To update the caption text in Footer.
if(e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemDeleted)
{
CaptionText = this.gridGroupingControl1.TableDescriptor.Name + ":" + this.gridGroupingControl1.Table.Records.Count + " Items";
this.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellValue = CaptionText;
}
} |
|
//Set the caption text to be displayed
captionText = this.gridGroupingControl1.TableDescriptor.Name + ":" + this.gridGroupingControl1.Table.Records.Count + " Items";
#region Grid customization
captionGrid = new GridControl();
captionGrid.Dock = DockStyle.Bottom;
captionGrid.Height = 35;
captionGrid.RowCount = 1;
captionGrid.ColCount = 1;
captionGrid.ShowRowHeaders = false;
captionGrid.ShowColumnHeaders = false;
captionGrid.HScroll = false;
captionGrid.VScroll = false;
//Set the height of the CaptionRow
captionGrid.DefaultRowHeight = 30;
captionGrid.DefaultColWidth = this.gridGroupingControl1.TableControl.Width - 18;
//Disable the editing
captionGrid[1, 1].CellType = GridCellTypeName.Static;
captionGrid[1, 1].CellValue = captionText;
#endregion
//To add the Caption row at the bottom of the grid
this.gridGroupingControl1.GridTablePanel.Controls.Add(captionGrid);
//Event Triggering
this.gridGroupingControl1.SourceListListChangedCompleted += GridGroupingControl1_SourceListListChangedCompleted;
//Event customization
private void GridGroupingControl1_SourceListListChangedCompleted(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
{
//To update the caption text in bottom.
if (e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemDeleted)
{
captionText = this.gridGroupingControl1.TableDescriptor.Name + ":" + this.gridGroupingControl1.Table.Records.Count + " Items";
captionGrid[1, 1].CellValue = captionText;
}
} |