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

[Solved] RadGrid - cannot call controls inside EditForm.

2 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JEFF KINSEY
Top achievements
Rank 1
JEFF KINSEY asked on 15 Sep 2009, 06:18 PM
Help!
I have a radgrid built that uses a custom editform.  In the updatecommand sub I follow all the Telerik standards... cast e.item to grideditableItem (id="eitem"); then search out controls by using trycast(eitem.findcontrol("object"), radtextbox).text.  This is how all the documentation is setup... but it will NOT work for me!  I have been working on this for 2 days now-- I have a note into Telerik support as well, but figured it couldn't hurt to ask the group...

I should add that I am using EditMode="popups" and EditFormType="templates".

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Sep 2009, 06:58 AM
Hello Jeff Kinsey,

I tried the following code at my end and it worked as expected. Check for differences with your code:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"     OnUpdateCommand="RadGrid1_UpdateCommand">                  
      <MasterTableView EditMode="PopUp">              
          <Columns> 
            ..... 
          </Columns>  
          <EditFormSettings EditFormType="Template" >  
             <FormTemplate> 
                 <telerik:RadTextBox ID="object" runat="server"></telerik:RadTextBox> 
                 <asp:Button ID="Button1" runat="server" Text="Update" CommandName="Update" /> 
                 <asp:Button ID="Button2" runat="server" Text="Cancel" CommandName="Cancel" /> 
              </FormTemplate> 
          </EditFormSettings>  
      </MasterTableView>  
</telerik:RadGrid>  

c#:
Protected Sub RadGrid1_UpdateCommand(source As Object, e As GridCommandEventArgs) 
    Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem) 
    Dim txt As String = (TryCast(item.FindControl("object"), RadTextBox)).Text 
End Sub 

 If this does not help, then consider pasting your entire code here.

Thanks
-Princy.
0
JEFF KINSEY
Top achievements
Rank 1
answered on 18 Sep 2009, 01:43 PM
Princy - thanks so much for the note and included code.  I have found a resolution.  Although your code provided (which is the same as support), worked for simple examples, it did not work in the case of my grid.  I did find a resolution with some consulting assistance, but cannot outline the solution at this time.  I still do not understand what about my grid makes it "more complex" and triggers the difference, but I will post a solution in the near future.  Thank you again for taking the time to comment and keep an eye out for a more detailed response.
Tags
Grid
Asked by
JEFF KINSEY
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
JEFF KINSEY
Top achievements
Rank 1
Share this question
or