This is a migrated thread and some comments may be shown as answers.

radgrid edit button does not change to cancel/update on edit

1 Answer 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 15 Nov 2011, 12:27 PM
Hi,

I have a RadGrid with a custom FormTemplate in the EditFormSettings and AutoGenerateEditColumn = "true".  On the RadGrid ItemDataBound, I successfully bind to the controls in my Edit Form.  This is done as follows:

protected void myRadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode) //bind edit form controls
            {
                int pkId = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MyPkID"].ToString());
                GridEditFormItem editFormItem = e.Item as GridEditFormItem;
                TextBox tb = editFormItem.FindControl("MyTextBox");
                tb.Text = "my text";
            }
        }

The edit form shows and is correctly populated with data.  The problem is, the 'Edit' link on the RadGrid row does not change to show the 'Update' and 'Cancel' links, so the row cannot be updated.  You can see, though, that e.Item.IsInEditMode is true, so why does the RadGrid not think the row is in Edit mode?   What am I missing?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Nov 2011, 12:55 PM
Hello,

I have tried to reproduce the same but no avail. You can take a look into the following demo.
Grid / Form Template Edit Form

Thanks,
Princy.
Tags
Grid
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or