views:

4693

answers:

3

I want to make the items of my RadGrid be editable on page load. I've tried both methods here http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html but neither have any effect.

The 2nd method for example, shown below where the Edit property is set on the ItemCreated event, causes the Edit mode to be set true (verified by debugger) but it has no effect on the results when the page is displayed.

Anyone have any ideas what I'm doing wrong?

protected void RadGrid1_ItemCreated(object sender, Telerik.WebControls.GridItemEventArgs e)
{
    if (!Page.IsPostBack && e.Item is GridEditableItem)
   {
       e.Item.Edit = true;
   }
}
+3  A: 

This works:

for (int i = 0; i < RadGrid1.PageSize; i++)
{
    RadGrid1.EditIndexes.Add(i);
}
Mr. Flibble
A: 

This also works:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    e.Item.Edit = true;
}
Rubens Farias
A: 

how can i close the edit form after inserting the data. in my case after inserting data edit for mis in open mode.\ please help me

I guess you have to set e.Item.Edit = false; at some point.Don't be afraid to start a new question to ask this.
Mr. Flibble