This is a migrated thread and some comments may be shown as answers.

Textbox Value in EditForm

3 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 14 Apr 2009, 04:31 PM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 15 Apr 2009, 04:43 AM
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.

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


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

Thanks
Shinu
0
Mark Galbreath
Top achievements
Rank 2
answered on 20 Oct 2009, 09:05 PM
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.
0
Pavlina
Telerik team
answered on 23 Oct 2009, 01:08 PM
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.

Regards,
Pavlina
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.
Tags
Grid
Asked by
Sean
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Mark Galbreath
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or