Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
change the colour of a row of a datagridview at page load
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Soumya Surendran
14y
6k
1
Reply
hai expert...................
I want to chage the colour of a particular row at load time..The form is loaded on MDI parent...I have used the following code...
dataGridView1.DataSource = dt;
for
(
int
i = 0; i < dataGridView1.Rows.Count; i++)
{
if
(
Convert
.ToString(dataGridView1.Rows[i].Cells[1].Value) ==
"OPENING BALANCE"
)
{
dataGridView1.Rows[i].DefaultCellStyle.BackColor =
Color
.AliceBlue;
dataGridView1.Rows[i].DefaultCellStyle.ForeColor =
Color
.Red;
}
}
Please help me...............
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
C# Homework help please URGENT
RichTextBox