Accessing RadGrid on Server-Side

Declarative Grid

<telerik:RadGrid ID="RadGrid1" runat="server"></telerik:RadGrid>
protected void RadButton1_Click(object sender, EventArgs e)
{
    RadGrid1.AllowSorting = true;
    RadGrid1.Rebind();
}

Dynamically created Grid

<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
protected void Page_Init(object sender, EventArgs e)
{
    RadGrid grid = new RadGrid();
    grid.ID = "RadGrid1";

    PlaceHolder1.Controls.Add(grid);
}

protected void RadButton1_Click(object sender, EventArgs e)
{
    RadGrid grid = PlaceHolder1.FindControl("RadGrid1") as RadGrid;
}
In this article
Not finding the help you need? Improve this article