gridview control in asp.net - alternate rows in different color
Howdy folks,
I am using ASP.net 3.5. I have a gridview web control on my .aspx page.
I have two questions about gridview control.
1. I display multiple rows in the gridview control. I want to display alternate rows in the grid in grey color (instead of displaying all rows in the grid in the same color). I explored in the gridview control properties. But I couldn't find any. May be I missed. Could some one give me some pointers please?
2. Is there a way to display rows in the gridview control across mulitple web pages? Say I have 200 rows in the grid. I would like to show say 50 rows per web page and the next 50 pages in the next page and so on.
Thanks
nath
Re: gridview control in asp.net - alternate rows in different color
Checkout this link for skinning a gridview http://msdn.microsoft.com/en-us/library/aa479342.aspx
it sounds to me like you are wanting paging on your webpages. On your gridview it has allowpaging, needs to be set to true and you need to set the codebehind to capture the event.
check out this link:
http://msdn.microsoft.com/en-us/libr...xchanging.aspx
Re: gridview control in asp.net - alternate rows in different color
Paging
Paging
If you're setting the gridview styles yourself, then handle the GridView's RowDataBound event. In it, look at the e.Row.ItemType or in the GridView markup, set the AlternatingRowStyle.
Re: gridview control in asp.net - alternate rows in different color
Thanks folks. Let me try those articles.
regards
nath
Re: gridview control in asp.net - alternate rows in different color
dude mark the thread is resolved...