问题描述
我有一个包含6列的DataGridView;我希望第一列显示一周中的日期。第二列应显示每天的时间表。但我希望它们以垂直顺序显示,而不是以水平方式显示。但我无法弄明白该怎么做。
我喜欢这样: []
我想这样: []
提前致谢
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
推荐答案
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.
这篇关于仅将值添加到DataGridView C#中的一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!