Click here to Skip to main content
15,902,823 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I am create windows application using c# 2010, in my application i am using datagridview for my billing form, but how to create vertical lines for datagridview.

Any one give me some ideas.

What I have tried:

How to crate columns line for datagridview in c# windows application
Posted
Updated 19-Jun-16 23:52pm
Comments
Herman<T>.Instance 20-Jun-16 5:49am    
Tried property DefaultCellStyle?

1 solution

try this

C#
dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
 
Share this answer
 
Comments
Boopalslm 20-Jun-16 5:58am    
Thanks, It' s working nice but hot to set line height same as to for my datagridview height
Karthik_Mahalingam 20-Jun-16 6:03am    
try this


dataGridView1.Rows.OfType<DataGridViewRow>().ToList().ForEach(row => row.Height = 50);
Karthik_Mahalingam 20-Jun-16 6:08am    
try this

foreach (DataGridViewRow row in dataGridView1.Rows)
row.Height = 50;
Karthik_Mahalingam 20-Jun-16 6:17am    
cool,
could you please close this post by clicking accept answer.
Karthik_Mahalingam 20-Jun-16 6:25am    
what is the reason that you have deleted all ur comments and undo the answer?

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