Results 1 to 4 of 4

Thread: [RESOLVED] Customizing my DataGridViewer - Question

  1. #1

    Thread Starter
    Addicted Member tgf-47's Avatar
    Join Date
    Feb 2010
    Location
    CapeTown, South Africa -34.01244,18.337415
    Posts
    209

    Resolved [RESOLVED] Customizing my DataGridViewer - Question

    I have a normal DGV on my form.

    To make this more readable I want to custom color the rows. 1 row blue, 1 row white, ex...

    I attached an image to show what I want to do. The smaller dgv in the picture is what i want to achieve.

    Can anyone help me?

    Name:  DGV.jpg
Views: 187
Size:  27.1 KB

  2. #2
    Fanatic Member Lerroy_Jenkins's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    661

    Re: Customizing my DataGridViewer - Question

    Hi there, I think this should work.

    vb Code:
    1. Dim i As Integer
    2.  
    3.         For i = 0 To dgvMembersInfo.RowCount
    4.             If i > dgvMembersInfo.RowCount Then
    5.                 Exit For
    6.             End If
    7.             dgvMembersInfo.Rows(i).DefaultCellStyle.BackColor = Color.Aqua
    8.             i += 2
    9.         Next

    But then again I might be wrong.
    Lerroy

    "η β π", or "Eta Beta Pi" (Eat A Better Pie)

    01001000
    01000101
    01001100
    01010000


    My Own Code - WordCounter

    Useful Forum Links -Reputation - What is it?

  3. #3
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: Customizing my DataGridViewer - Question

    use the AlternatingRowsDefaultCellStyle property of the dgv

  4. #4
    Fanatic Member Lerroy_Jenkins's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    661

    Re: Customizing my DataGridViewer - Question

    Wow, I didnt realise you could do that...
    Lerroy

    "η β π", or "Eta Beta Pi" (Eat A Better Pie)

    01001000
    01000101
    01001100
    01010000


    My Own Code - WordCounter

    Useful Forum Links -Reputation - What is it?

Tags for this Thread

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