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:
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?
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?