Click here to Skip to main content
14,733,819 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The datagridview row header is coming as parent form. if the background form is black color then datagridview row header is coming as black.

<img src="" border="0" alt="Image and video hosting by TinyPic">

below is the link for snapshot[^]

Thanks & Regards,
Christian Amado 29-Aug-12 12:03pm
RowHeaderStyle setting background color?
Md Athaulla 30-Aug-12 2:22am
Thanks for the reply. I have changed the background color to dimgray but i guess the actual problem is, datagridview is not getting refreshed. even the datagridview rows are not coming proper.

<img src="" border="0" alt="Image and video hosting by TinyPic">

Please click below link
Dasaradhi_r 30-Aug-12 6:04am
1) What do you mean by "datagridview is not getting refreshed"?
2. Just setting the back color will not help. You have to set
EnableHeadersVisualStyles property to false.
Did you try the solution I gave?
Md Athaulla 30-Aug-12 7:02am
I have Tried the solution you have given but still im facing the same problem. please look at the snapshot for more details.
Dasaradhi_r 30-Aug-12 7:16am
How is it looking if you set RowHeadersVisible = false?
Md Athaulla 30-Aug-12 9:05am
ya i have tried this. but still there is some problem. we need row header.

Please have a look at the following link
Dasaradhi_r 30-Aug-12 9:11am
Why don't you try to have just one grid in a separate form and test it from there.
Obviously I am not sure about the complexity of your project, I feel some thing fishy about the form or container in which your grid has been placed.
Md Athaulla 30-Aug-12 9:23am
ya i have put the datagridview inside groupbox. ill try to remove the groupbox and check. one more thing i want to know. Is there any plugin available for vs2008 to check the performance. i wanna know which instruction takes more time?
Dasaradhi_r 30-Aug-12 9:52am
Please Check this, it may help you.
Md Athaulla 31-Aug-12 1:35am
Thanks for the reply. that "Analyze" menu is not available in vs2008 professional. it is available only in "VS2008 team suite" version. anyways thanks for the reply.
Dasaradhi_r 31-Aug-12 1:45am
1) Is the row header issue resolved? How is it looking outside the container?
2) If you want to verify the performance, have stats for the following:
(i) Check how much time is taken for data retrieval from the data base?
(ii) How much time is taken for the data to be retrieved from you data access
layer to presentation layer
(iii) How much time is taken for the data binding.
(That is time for painting the grid on to the form)
Md Athaulla 31-Aug-12 6:59am
1)yes it is still the same outside the container. but in the client machine it is working fine.
2)we are using file system more than database. we receive ecg data through serial port then plot it on the screen. at last we will store that data in a file. so we are using more, drawing and serialport communication operations.

1 solution

If you don't want to have a row header, set the "RowHeadersVisible" property of datagridview to false as given below:
dataGridView1.RowHeadersVisible = false;

If you want to set a different color to row header, use the code below:
dataGridView1.RowHeadersDefaultCellStyle.BackColor = Color.Red;
dataGridView1.EnableHeadersVisualStyles = false;

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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