Hi,
I have a grid with auto-generated columns. The grid is filled during run time (via a SQL query).
I try to use Edit Form for Update/Insert. The grid renders correctly...the Edit Form opens correctly when I click either the Update link or the Add New Record link.
I use the RadGrid1_UpdateCommand to process the update event. I try to extract the changed value from the textbox in the edit form, but the textbox.text returns the old value and not the new value. Hence I cannot process the update. Same is true with the insert.
I spent hours checking postings and demo materials and couldn't find the answer. Very frustrating and time-consuming. Just about ready to abandon this but thought I should give me one last shot and hopefully someone will be able to offer some advise.
Below are the code snippets. Any comments or advise will be greatly appreciated.
Thanks.
Barry
I have a grid with auto-generated columns. The grid is filled during run time (via a SQL query).
I try to use Edit Form for Update/Insert. The grid renders correctly...the Edit Form opens correctly when I click either the Update link or the Add New Record link.
I use the RadGrid1_UpdateCommand to process the update event. I try to extract the changed value from the textbox in the edit form, but the textbox.text returns the old value and not the new value. Hence I cannot process the update. Same is true with the insert.
I spent hours checking postings and demo materials and couldn't find the answer. Very frustrating and time-consuming. Just about ready to abandon this but thought I should give me one last shot and hopefully someone will be able to offer some advise.
Below are the code snippets. Any comments or advise will be greatly appreciated.
Thanks.
Barry
| <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="EditDepartment.aspx.vb" Inherits="EditDepartment" title="Untitled Page" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> |
| |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <asp:Panel ID="Panel2" runat="server" BorderColor="Silver" BorderStyle="solid" BorderWidth="1px" |
| Height="200px" Style="z-index: 101; left: 4px; position: relative; top: 0px" |
| Width="95%"> |
| <telerik:RadTextBox ID="radTextBox2" runat="server" Style="z-index: 101; left: 1px; |
| position: absolute; top: 6px" Text="abc" Width="100px"> |
| </telerik:RadTextBox> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| GridLines="None" AutoGenerateColumns="True" AutoGenerateEditColumn = "true" |
| Skin="Office2007" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" |
| AllowAutomaticUpdates="true" ShowFooter="True" > |
| <MasterTableView CommandItemDisplay="Bottom"> |
| <EditFormSettings> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| </MasterTableView> |
| <ClientSettings EnablePostBackOnRowClick="True"> |
| </ClientSettings> |
| </telerik:RadGrid></asp:Panel> |
| </asp:Content> |
| Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand |
| Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) |
| Dim textbox As TextBox |
| textbox = CType(editedItem("description").Controls(0), TextBox) |
| End Sub |