Chinna Netha

Chinna Netha

  • NA
  • 282
  • 138.1k

how to selected row in GridView on LinkButton Click event?

Dec 17 2014 7:45 AM


<asp:GridView ID="grdtopic" runat="server" AutoGenerateColumns="false" CssClass="grdtopic" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" OnRowCommand="grdtopic_RowCommand" Width="200px" OnSelectedIndexChanged="grdtopic_SelectedIndexChanged">
<AlternatingRowStyle BackColor="#DCDCDC" />
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#0000A9" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#000065" />


<Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblId" runat="server" Text='<%# Eval("TopicID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Topic">
<ItemTemplate>
<asp:LinkButton ID="lblTopic" OnClick="Senddata_Click" CommandName="Select" CommandArgument='<%# Eval("TopicID") %>' runat="server"><%# Eval("Topic Name") %> Paper</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

how to selected row in GridView on LinkButton Click event or SelectedIndexChanged?
 plz help sir ....
that gridview selectedvalue display on label .....
plz plz plz help me...........

Answers (1)