Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
810
Method to get the row index
posted

Hi all,

 

Is there a way to get the selected row index of the webdatagrid on the serverside button event

which is inside the templatedatafield of the webdatagrid.

 

Thanks

  • 5739
    posted

    Hi,

    Now that I saw this post, I understand what was bothering me about the other post.  Here's how to get the row info.

    <ig:TemplateDataField Key="SelectButton" >

    <ItemTemplate>

    <asp:LinkButton ID="SelectLink" CommandName="SelectedClick" CommandArgument='<%# DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "CustomerID") %>' runat="server">Select</asp:LinkButton>

    </ItemTemplate>

    </ig:TemplateDataField>

    in code behind:

     

     

     

     

     

    Protected Sub WebDataGrid1_ItemCommand(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.HandleCommandEventArgs) Handles WebDataGrid1.ItemCommand

     

    customerId = e.CommandArgument.ToString

     

    End Sub

    The markup here is only for VB.  For c# and for getting the row.index see this post:

    http://forums.infragistics.com/forums/p/32581/181994.aspx#181994

    Ed