Click here to Skip to main content
14,690,522 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to change the colour of particular row in data Grid view
Posted
Comments
Sandeep Mewara 25-Oct-10 12:11pm
   
Web or Winforms?

Different colors for the cell values.... u can try this:


<pre lang="vb">

For Each row As DataGridViewRow In Me.DG.Rows
              
               Dim deger as String
               deger = row.Cells(2).Value

              
               If deger="Giris" Then row.DefaultCellStyle.BackColor = Color.IndianRed
              
               If deger="Cikis" Then row.DefaultCellStyle.BackColor = Color.LightSalmon
               
           Next

   
See here[^].
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900