I know its a old topic,For a beginner its a grt help!!!!
Code:
<asp:GridView ID="GridViewNotSelected" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataSourceID="SqlDataSourceTagsNotSelected"
onrowcommand="GridViewNotSelected_RowCommand">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandArgument='<%# Eval("Id") %>'
CommandName="Select" Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
AutoGenerateColumns="False"
DataSourceID="SqlDataSourceTagsNotSelected"
onrowcommand="GridViewNotSelected_RowCommand">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandArgument='<%# Eval("Id") %>'
CommandName="Select" Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void GridViewNotSelected_RowCommand(object sender, GridViewCommandEventArgs e) { int tagsId = Convert.ToInt32(e.CommandArgument); }
Protected Sub GridViewNotSelected_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
Dim tagsId As Integer = Convert.ToInt32(e.CommandArgument)
End Sub
If u had any trouble just ask, Happy to help u :)
Stay Tune... Have a nice day... 'N happy Coding :)
No comments:
Post a Comment