Grid
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="false" onrowcommand="grid_RowCommand" >
<Columns>
<asp:TemplateField >
<ItemTemplate>
<asp:TextBox ID="txt" runat="server" Text='<%#Eval("xxx") %>' > </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txt" runat="server" Text='<%#Eval("xxx") %>' > </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:LinkButton ID="lnk" CommandArgument=<%# Container.DataItemIndex + 1 %> CommandName="arg">Click</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnk" CommandArgument=<%# Container.DataItemIndex + 1 %> CommandName="arg">Click</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:GridView>
Code
protected void grid_RowCommand(object sender, GridViewCommandEventArgs e)
{
int rowindex = int.Parse(e.CommandArgument.ToString());
((TextBox)(grid.Rows[rowindex].FindControl("txtgvunit"))).Text
}
thank u....
ReplyDelete