Get control of RaGrid through asp button

2 posts, 1 answers
  1. John
    John avatar
    7 posts
    Member since:
    Jul 2013

    Posted 11 Jul 2013 Link to this post


    I have a RadGrid Inside TabTemplate of RadTabStrip. I upload the data to RadGrid from an asp button click event(c# ode).

    The problem is I am not able to findcontrol of RadGrid from the button. 

    Can someone tell me how to get around this problem?

    Code for Button:

    protected void Button2_Click(object sender, EventArgs e)
    radgrid1.DataSource=list; // list is my data source

    Also, I don't have license to Radtabs hence using TabTemplate. I have also tried findcontrol but its not working with button EvenArgs.

    RadGrid grv1 = (RadGrid)RadTabStrip1.FindControl("radgrid1");

  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2013 Link to this post

    Hi John

    Try the following code snippet to access the control inside TabTemplate
    protected void button_Click(object sender, EventArgs e)
           RadTab tab = (RadTab)RadTabStrip1.FindTabByText("Products"); // Get the tab
           RadGrid rGrid = (RadGrid)tab.FindControl("RadGrid1");

Back to Top