I have a RadGrid that is populated in the code-behind with a DataTable. The grid has an edit FormTemplate:
When I click the 'Edit' button on a row, the edit form pops up, I enter the Description textbox, and click the Update button. Control goes to
the problem is that the TextBox value is the original value of description for that row, not the new value typed into the textbox. Why? Can't figure out why it does not result in the new value.
The GridEditableItem grdSelected object is showing:
<
telerik:RadGrid
ID
=
"rgFileList"
runat
=
"server"
OnItemCommand
=
"rgFileList_ItemCommand"
>
<
MasterTableView
HorizontalAlign
=
"Right"
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
table
style
=
"width: 85%"
align
=
"center"
>
<
tr
>
<
td
style
=
"width: 35%"
align
=
"right"
>Description: </
td
>
<
td
style
=
"width: 65%"
>
<
asp:TextBox
ID
=
"txtDescription"
runat
=
"server"
Text='<%# Bind("description") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
><
tdcolspan
=
"2"
> </
td
></
tr
>
<
tr
>
<
td
colspan
=
"2"
align
=
"center"
>
<
asp:Button
ID
=
"btnUpdate"
runat
=
"server"
Text
=
"Update"
CommandName
=
"Update"
/>
<
asp:Button
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Cancel"
CommandName
=
"Cancel"
/>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
When I click the 'Edit' button on a row, the edit form pops up, I enter the Description textbox, and click the Update button. Control goes to
rgFileList_ItemCommand where the code is:
protected void rgFileList_ItemCommand(object source, GridCommandEventArgs e)
{
string strCommand = e.CommandName.ToUpper().Trim();
if (strCommand == "UPDATE")
{
GridEditableItem grdSelected = (GridEditableItem)e.Item;
string filename = grdSelected.GetDataKeyValue("filename").ToString().Trim();
TextBox tb = (TextBox)grdSelected.FindControl("txtDescription");
string description = tb.Text.ToString().Trim();
the problem is that the TextBox value is the original value of description for that row, not the new value typed into the textbox. Why? Can't figure out why it does not result in the new value.
The GridEditableItem grdSelected object is showing:
EditManager = 'grdSelected.EditManager' threw an exception of type 'Telerik.Web.UI.GridBindingException'GridEditableItem
{"The current EditFormType does not support the requested editing capabilities."}