Hi Telerik
We decided to use your new feature (Multi columns) in a RadGrid.
<telerik:GridCheckBoxColumn DataField="Image" HeaderText="Image" ColumnGroupName="Image" />
In our scenario we are dynamically adding controls to a header cell.
protected void RadGridImages_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridHeaderItem)
{
GridHeaderItem headeritem = (GridHeaderItem)e.Item;
CheckBox checkBox = new CheckBox();
checkBox.Checked = ShowAll;
checkBox.Text = "Show all";
checkBox.ID = "CheckBoxShowAll";
checkBox.AutoPostBack = true;
checkBox.CheckedChanged += new EventHandler(checkBox _CheckedChanged);
headeritem["ShowAll"].Text = "Show all";
headeritem["ShowAll"].Controls.Add(checkBox);
}
}
It works perfect without using the multi columns function. However, a problem by adding a control dynamically occurs. We have obtained this error:
“Specified argument was out of the range of valid values. Parameter name: index”
Is there any way to dynamically add control to header cell in case of using multi column function, please?
By removing the information about group and group definition, everything works perfect again. When we apply multi columns functionality and delete the functionality of dynamically control adding, everything works well too.
Thank you in advance for your advice.