Hi,
I want to create a grid which sets all the records in Edit mode when the page is loaded. I use "In=place" edit mode. I do it following the codes (the same way as instructed from page http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html or page http://www.telerik.com/help/aspnet-ajax/grdputallitemsineditmodenoadditionalrebind.html)
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < RadGrid1.PageSize; i++)
{
RadGrid1.EditIndexes.Add(i);
}
}
OR
private void RadGrid1_PreRender(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
foreach(GridItem item in RadGrid1.MasterTableView.Items)
{
if (item is GridEditableItem)
{
GridEditableItem editableItem= item as GridDataItem;
editableItem.Edit = true;
}
}
RadGrid1.Rebind();
}
The grid works fine om the first page load, but both of the above approaches fail when any postback happens (i.e. when users change to the next page).
So how could I handle the postback event so that all records, for example of the next page, are still in Edit mode after postback?
Regards,
Quan
I want to create a grid which sets all the records in Edit mode when the page is loaded. I use "In=place" edit mode. I do it following the codes (the same way as instructed from page http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html or page http://www.telerik.com/help/aspnet-ajax/grdputallitemsineditmodenoadditionalrebind.html)
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < RadGrid1.PageSize; i++)
{
RadGrid1.EditIndexes.Add(i);
}
}
OR
private void RadGrid1_PreRender(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
foreach(GridItem item in RadGrid1.MasterTableView.Items)
{
if (item is GridEditableItem)
{
GridEditableItem editableItem= item as GridDataItem;
editableItem.Edit = true;
}
}
RadGrid1.Rebind();
}
The grid works fine om the first page load, but both of the above approaches fail when any postback happens (i.e. when users change to the next page).
So how could I handle the postback event so that all records, for example of the next page, are still in Edit mode after postback?
Regards,
Quan