How to find control inside GridTableView

2 posts, 0 answers
  1. Mayank
    Mayank avatar
    5 posts
    Member since:
    Jan 2014

    Posted 11 Apr 2014 Link to this post

     protected void GridsettSave_Click(object sender, EventArgs e)
     foreach (GridDataItem item in RadGridCommonSetting.Items)
                    RadSkinManager Skin = item.FindControl("Skin") as RadSkinManager;
                    DropDownList CellSelectionMode = item.FindControl("CellSelectionMode") as DropDownList;
    but this code shows Null every time
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Apr 2014 in reply to Mayank Link to this post

    Hi Mayank,

    I am not sure about your requirement. I guess that you are trying to access ItemTemplate controls of RadGrid on Button Click event. Please have a look into the sample code snippet which works fine at my end. 

    <telerik:RadGrid ID="RadGridCommonSetting" runat="server" DataSourceID="SqlDataSource1"
                <telerik:GridBoundColumn DataField="OrderID" UniqueName="OrderID">
                <telerik:GridBoundColumn DataField="CustomerID" UniqueName="CustomerID">
                <telerik:GridTemplateColumn UniqueName="Template">
                        <telerik:RadSkinManager ID="Skin" runat="server">
                        <asp:DropDownList ID="CellSelectionMode" runat="server">
                            <asp:ListItem Text="Item1">
    <telerik:RadButton ID="RadButton1" runat="server" Text="AccessItem" OnClick="RadButton1_Click">

    protected void RadButton1_Click(object sender, EventArgs e)
        foreach (GridDataItem item in RadGridCommonSetting.Items)
            RadSkinManager skin = item.FindControl("Skin") as RadSkinManager;
            DropDownList CellSelectionMode = item.FindControl("CellSelectionMode") as DropDownList;

    Please elaborate your requirement if it doesn't help. 
Back to Top