fetch the row index and row items on click of button.

2 posts, 0 answers
  1. amit
    amit avatar
    2 posts
    Member since:
    Feb 2016

    Posted 28 Feb 2016 Link to this post


    Need urgent help.

    I am working on radgrid.

    <telerik:GridBoundColumn SortExpression="BPMTempCheck" HeaderText="BPMTempCheck" AllowSorting="false"
                                HeaderButtonType="TextButton" DataField="BPMTempCheck" UniqueName="BPMTempCheck"
                                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="75px" Display="false">
    <telerik:GridBoundColumn SortExpression="ActionType" HeaderText="ActionType" AllowSorting="false"
                                HeaderButtonType="TextButton" DataField="ActionType" UniqueName="ActionType"
                                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="75px" Display="false">
    <telerik:GridTemplateColumn HeaderText="Shop Code" UniqueName="ShopCode">
                                    <asp:TextBox ID="txtShopCode" runat="server"></asp:TextBox>                                                                                                
    <telerik:GridTemplateColumn HeaderText="Reporting Unit" UniqueName="ReportingUnit">
                                    <asp:TextBox ID="txtReportingUnit" runat="server"></asp:TextBox>
                                    <asp:Button ID="btnUploadGRS" runat="server" Text="Upload to GRAPE" OnClick="btnUploadGRS_Click" />


    i want to fetch the row index and the other columns details on onClick event of the button "btnUploadGRS_Click". I want to fetch the details of the row in which button is clicked.

    How can i get the details in the code behind file.




  2. Vessy
    Vessy avatar
    1641 posts

    Posted 02 Mar 2016 Link to this post

    Hi Amit,

    You can get access to the naming container of the button (the GridDataItem) in a similar way:
    protected void btnUploadGRS_Click(object sender, EventArgs e)
        System.Web.UI.WebControls.Button btn = (System.Web.UI.WebControls.Button)sender;
        GridDataItem item = (GridDataItem)btn.NamingContainer;
        //your code here, e.g.:
        TextBox tb = (TextBox)item.FindControl("txtReportingUnit");

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top