Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a DataGridView with 6 columns; I want the first column to display the days of the week. And the second column should display a schedule per day. But I want them to display in vertical order, not in horizontal way. But I can't figure out how to do it.

I have it like this: http://i.stack.imgur.com/0AhMj.jpg[^]

And I want it like this: http://i.stack.imgur.com/IHpyd.jpg[^]

Thanks in advance
Posted
Updated 3-Feb-15 5:13am
v6
Comments
Jeet Gupta 3-Feb-15 0:56am    
can u display how exactly you want the horizental view
Sinisa Hajnal 3-Feb-15 2:32am    
You have to wrap html into <pre> tags otherwise it will not be shown. Check your question you'll see there is nothing there :)
ChrisCreateBoss 3-Feb-15 10:37am    
Sorry :D, in the preview, the links where shown.
CHill60 3-Feb-15 11:14am    
I've fixed the links for you (finally!) - you were missing the href and the pre-tags didn't help

1 solution

I finally solved my problem, using this code:

dataGridView1[2, 0].Value = "7:00 - 7:50";<br />
           dataGridView1[2, 1].Value = "7:50 - 8:40";<br />
           dataGridView1[2, 2].Value = "8:40 - 9:30";<br />
           dataGridView1[2, 3].Value = "10:00 - 10:50";<br />
           dataGridView1[2, 4].Value = "10:50 - 11:40";<br />
           dataGridView1[2, 5].Value = "11:50 - 12:40";<br />
           dataGridView1[2, 6].Value = "12:40 - 1:30";<br />


It is similar to the coordinate plane, the first number references the number of column, and the second number references the cell that I want to modify. Now I have a bigger problem, about the same project, I'll post it in a minute. Please Help me with that one, I'm trying to solve it since four hours.
 
Share this answer
 
Comments
Sinisa Hajnal 4-Feb-15 2:24am    
You could've done it with a loop, but I guess for this small sample it is not really needed. Please post the link to your new question here.
ChrisCreateBoss 4-Feb-15 7:43am    
http://www.codeproject.com/Questions/872457/Save-and-load-DataGridView-content-and-cell-style

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