Results 1 to 5 of 5

Thread: gridview control in asp.net - alternate rows in different color

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    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

  2. #2
    Lively Member
    Join Date
    Oct 2008
    Posts
    87

    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

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Re: gridview control in asp.net - alternate rows in different color

    Thanks folks. Let me try those articles.

    regards
    nath

  5. #5
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Re: gridview control in asp.net - alternate rows in different color

    dude mark the thread is resolved...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width