BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Grid.CellRenderers.Remove("StackedHeader"); Grid.CellRenderers.Add("StackedHeader", new GridStackedHeaderCellRendererExt(Grid));
...
...
public class GridStackedHeaderCellRendererExt : GridStackedHeaderCellRenderer { private SfDataGrid totalPaidGrid; public GridStackedHeaderCellRendererExt(SfDataGrid totalPaidGrid) { // TODO: Complete member initialization this.totalPaidGrid = totalPaidGrid; } // override the OnInitializeEditElement public void OnInitializeEditElement( Syncfusion.UI.Xaml.ScrollAxis.RowColumnIndex rowColumnIndex, GridStackedHeaderCellControl uiElement, GridColumn column, object dataContext) { var colum = (dataContext as StackedColumn); if (colum.ChildColumns.Contains("Total")) { var style = totalPaidGrid.Resources["customCellStyleStackedHeaderTotal"] as Style; uiElement.Style = style; } else { var style = totalPaidGrid.Resources["customCellStyleStackedHeader"] as Style; uiElement.Style = style; }base.OnInitializeEditElement(rowColumnIndex, uiElement, column, dataContext);
} }
public class GridStackedHeaderCellRendererExt : GridStackedHeaderCellRenderer { private SfDataGrid totalPaidGrid;
public GridStackedHeaderCellRendererExt(SfDataGrid totalPaidGrid) { // TODO: Complete member initialization this.totalPaidGrid = totalPaidGrid; } // override the OnInitializeEditElement
public override void OnInitializeEditElement(DataColumnBase dataColumn, GridStackedHeaderCellControl uiElement, object dataContext) { var colum = (dataContext as StackedColumn); if (colum.ChildColumns.Contains("Total")) { var style = totalPaidGrid.Resources["customCellStyleStackedHeaderTotal"] as Style; uiElement.Style = style; } else { var style = totalPaidGrid.Resources["customCellStyleStackedHeader"] as Style; uiElement.Style = style; } base.OnInitializeEditElement(dataColumn, uiElement, dataContext); } |