No. In the sample code the problem does not occur. I just did the test by removing the columns of the grouping columns and everything returned to normal operation. How do I accomplish creating grouped columns through code. The sample code I posted is correct? There are more recommendations for this practice?
See the excerpt from my class where I create the columns with grouping:
private ColumnBase CreateStringColumn(GridColumn column)
{
var col = column.SummaryType != GridColumnSummary.None ? new SummaryColumn() : new Column();
col.Text = column.Caption;
if (column.Columns.Any())
{
foreach (var gridColumn in column.Columns)
{
col.Columns.Add(CreateColumnProxy(gridColumn));
}
}
else
{
col.ID = column.UniqueName + Id;
col.Align = ConvertAlignment(column.HorizontalAlign);
col.DataIndex = column.DataField;
col.Visible = column.Visible;
col.Flex = (column.Width == 0) ? 1 : 0;
col.Wrap = true;
if (column.Width > 0)
col.Width = Unit.Pixel(column.Width);
if (!column.ReadOnly)
{
var textField = new TextField { AllowBlank = !column.IsRequired, IsRemoteValidation = false };
if (!column.FormatString.IsNullOrEmpty())
textField.Plugins.Add(new InputMask { Mask = column.FormatString });
if (!column.ChangeEvent.IsNullOrEmpty())
{
textField.IsRemoteValidation = true;
textField.RemoteValidation.DirectFn = column.ChangeEvent;
}
if (column.IsValidation)
{
textField.IsRemoteValidation = true;
textField.RemoteValidation.Validation += column.OnValidation;
}
col.Editor.Add(textField);
}
if (HeaderEditable)
col.HeaderItems.Add(new TextField { ID = "h" + column.DataField + Id, Disabled = column.ReadOnly });
if (!string.IsNullOrWhiteSpace(column.ColumnRender))
col.Renderer.Handler = column.ColumnRender;
if (column.SummaryType != GridColumnSummary.None)
{
((SummaryColumn)col).SummaryType = ConvertSummaryType(column.SummaryType);
((SummaryColumn)col).SummaryRenderer.Fn = ConfigureFormat(column);
}
}
return col;
}
There's nothing else in creation. Realize the creation of Column and add new columns in the Columns property based on class ColumnBase. I have methods that create columns according to their type (Column, DateColumn, CheckColumn) but these methods always return the type ColumnBase to be compatible with the grouping columns.
I do not know what to look for. I'm coming to the conclusion not to use this feature.
Thanks!
Ermanni.