Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight row in a datagrid

Status
Not open for further replies.

Dronealone

IS-IT--Management
Mar 13, 2002
64
GB
Hi,

I have the following datagrid, and wish to highlight the selected row after the link has been clicked. Can anybody help?

<asp:DataGrid id="dgDocSections" runat="server" AutoGenerateColumns="False" Font-Size="10pt" Font-Names="Arial" CellPadding="5" CellSpacing="5">
<HeaderStyle Font-Bold="True"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Document Section">
<ItemTemplate>
<a href='Docs.aspx?ID=<% Response.Write(Request.QueryString["ID"]); %>&docSectionID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</a>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

Thanks!
 
Try manipulating the SelectedItemStyle, then add a Select ButtonColumn (under the Columns... property). It should be a piece of cake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top