I'm moving to using a PopUp template for the updating of records within a RadGrid, but am unable to retrieve the updated value from my text box, it keeps returning the original value.
Below I've included a very simple grid with just the one column and the same is happening.
| <telerik:RadGrid ID="rgTestData" runat="server" AutoGenerateColumns="False" GridLines="None" |
| Skin="WebBlue" Width="600px" OnInsertCommand="rgTestData_InsertCommand" OnCancelCommand="rgTestData_CancelCommand" |
| OnUpdateCommand="rgTestData_UpdateCommand" AllowPaging="True" AutoGenerateEditColumn="True" |
| OnItemCommand="rgTestData_ItemCommand"> |
| <HeaderContextMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <MasterTableView CommandItemDisplay="TopAndBottom" EditMode="PopUp"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="genericName" HeaderText="Generic Name" UniqueName="genericName"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <EditColumn AutoPostBackOnFilter="True" UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| <FormTemplate> |
| <telerik:RadTextBox ID="txtGenericName" runat="server" Skin="WebBlue" Width="125px" |
| Text='<%# Bind("genericName") %>'> |
| </telerik:RadTextBox> |
| <br /> |
| <asp:LinkButton ID="btnSave" runat="server" Text="Save" CommandName="Update" /> |
| <asp:LinkButton ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" /> |
| </FormTemplate> |
| </EditFormSettings> |
| </MasterTableView> |
| <FilterMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
I'm then very simply trying to pull back the new value I've entered in the textbox after the Update button is pressed.
| protected void rgTestData_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.UpdateCommandName) |
| { |
| if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| String GenericName = item["genericName"].Text.ToString(); |
| } |
| } |
| } |
Thanks in advance for any help provided in resolving my problem.