I have this block in code for styling stacked headers. It used to work fine but after upgrade to v2 throws compilation errors. The signature of
OnInitializeEditElement has changed.
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);
}
}