How to set EditFormColumnIndex for autogeneratedcolumns in radgrid. radgrid doesn't have any static headers by default.
I am using:
protected void rgControl_PreRender(object sender, EventArgs e)
{
int j = 0, k = 1;
foreach (GridColumn gc in rgControl.MasterTableView.AutoGeneratedColumns)
{
if (j < k * 7)
{
gc.EditFormColumnIndex = k - 1;
}
else
{
k++;
gc.EditFormColumnIndex = k - 1;
}
j++;
}
}
It works good but when i am edit a record it shows the following error: Sys.WebForms.PageRequestManagerServerErrorException: Editor cannot be initialized for column:5.
I am using:
protected void rgControl_PreRender(object sender, EventArgs e)
{
int j = 0, k = 1;
foreach (GridColumn gc in rgControl.MasterTableView.AutoGeneratedColumns)
{
if (j < k * 7)
{
gc.EditFormColumnIndex = k - 1;
}
else
{
k++;
gc.EditFormColumnIndex = k - 1;
}
j++;
}
}
It works good but when i am edit a record it shows the following error: Sys.WebForms.PageRequestManagerServerErrorException: Editor cannot be initialized for column:5.