Textbox Value in EditForm

4 posts, 0 answers
  1. Sean
    Sean avatar
    3 posts
    Member since:
    Apr 2009

    Posted 14 Apr 2009 Link to this post

    I am using this code to get the value of a textbox in my editform but it wont get the data after i change it

    newValues("Notes") = CType(e.Item.FindControl("textbox11"), TextBox).Text

    if i open the editform and the text in the textbox says "12345" and i change it to "54321" and press update it returns "12345" no matter what i change the text to it always just brings back the text from the database and not what i changed it to
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Apr 2009 Link to this post

    Hi Sean,

    I guess you are using a FormTemplate. If so you can give a try with the following approach to access the updated text. If this does not help consider sending your aspx and code behind.

     <EditFormSettings EditFormType="Template" > 
                          <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                          <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" >Update</asp:LinkButton> 

            Protected Sub RadGrid1_UpdateCommand(ByVal source As ObjectByVal e As GridCommandEventArgs)  
                Dim edititem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)  
                Dim txtbx As TextBox = DirectCast(edititem.FindControl("TextBox1"), TextBox)  
                Dim strtxt As String = txtbx.Text  
            End Sub  

  3. DevCraft R3 2016 release webinar banner
  4. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 20 Oct 2009 Link to this post

    This code did not work for me; my string kept reverting back to the original as well.  I never did find a solution, and Telerik kept feeding me the same solution, so I just wrote my own event handler.  So much for the $800 I spent.
  5. Pavlina
    Pavlina avatar
    6069 posts

    Posted 23 Oct 2009 Link to this post

    Hello Mark,

    At this point I in order to progress in the resolution of this problem I will ask you to open a formal support ticket and send us a simple working project with reproduced this erroneous behavior. Thus we could do our best to help you further in resolving it.

    Looking forward for your reply.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top