Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I develop window application in c# and i am using data grid.
My code is:

C#
private void createtable()
        {
            dt = new DataTable();
            dt.Columns.Add("Frame");
            dt.Columns.Add("Time");
            dt.Columns.Add("Data");
        }


// method for add data in data grid.
C#
public void messagedisplay(string msg)
        {
            dt.Rows.Add(frmno, totalsec, msg);
            grid1.DataSource = dt;
            grid1.Columns[0].Width = 150;
            grid1.Columns[1].Width = 150;
            If(frmno==5)
            what code i write here.....
        }

I want to do when frmno is 5 i want this row color yellow.
Posted
Updated 24-Dec-11 1:09am
v2

1 solution

C#
dgv1.Rows(1).DefaultCellStyle.BackColor = Color.Yellow
 
Share this answer
 
v2
Comments
jaideepsinh 27-Dec-11 2:26am    
Thank's.

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