Tuesday, June 21, 2011

How to set row index to CommandArgument in the templatefield of Gridview


CommandArgument="<%# Container.DataItemIndex %>"




        <asp:TemplateField >
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" Text="Remove" CommandArgument="<%# Container.DataItemIndex %>"></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>

No comments:

Post a Comment