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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with asp:GridView and adding row separator

Status
Not open for further replies.

sonya9879

Programmer
Jun 18, 2004
147
0
0
CA
Hi, I have been trying unsuccessfully to add a horizontal line separator (an image line or <hr> rule) after each row in my asp:gridview but I haven't manage to find a way to do this. Does anyone has an idea on how to do it? There must be a way that we can add a separator after each row. It sounds like a simple thing but I can't figure it out :(.

Billion thanks to whoever can share some light!
 
You could use CSS and apply a border to each "tr" element.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
hi there, but i am using asp:TemplateField for each column, in fact I dont use HTML within the gridview tag. isn't there another simple way?
 
You don't have to use HTML within the GridView. The GridView simply writes out a HTML table to the browser so you can still apply the CSS as normal.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thanks but this "solution" wouldn't work for me because I have several other tables on the same page. Anybody else know if it is possible to add a line after each row in a GridView? Must be something withing the Grid to achieve this line OnRowCreated or something similar perhaps???
 
You can make a style just for that gridview that adds a line at the bottom of a <tr> tag. that is your best, and easiest solution.
 
thanks but this "solution" wouldn't work for me because I have several other tables on the same page
It is completely irrelevant whether you have other tables on the page or not. The GridView renders a table so a border can be applied to each Row therefore creating a seperator.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top