Displaying data in a table?

Yuliya

Active member
Joined
Nov 9, 2007
Messages
34
Programming Experience
Beginner
I need to display a table on a Windows Form, with the columns representing dates and the rows representing meals (breakfast, lunch, dinner -- it's a meal planning application). The cells need to be editable. What's the best way to do it?

I am trying to do this using DataGridView, but I can't figure out how to display text in the header cells of the rows. Also, if I do that, I would have to add the 3 rows dynamically at load time. I keep thinking there must be a better way.

Thank you!
 
E.g.
VB.NET:
Me.DataGridView1.Rows(1).HeaderCell.Value = "Row 1"
That said, you might be better off using a TableLayoutPanel and adding individual controls to the cells.
 
I need to display a table on a Windows Form, with the columns representing dates and the rows representing meals (breakfast, lunch, dinner -- it's a meal planning application). The cells need to be editable. What's the best way to do it?

I am trying to do this using DataGridView, but I can't figure out how to display text in the header cells of the rows. Also, if I do that, I would have to add the 3 rows dynamically at load time. I keep thinking there must be a better way.

Thank you!


Actually. i think it would be far better to rotate your grid..

Breakfast Lunch and Dinner are limited in number and will not grow.. Incase you didnt notice, tabular data tends to be fixed width and variable length. i.e. your database tables have new rows added, not new columns, when you want to store data. A table of a million people has a million rows and 10 columns of info about the person.. not 10 rows and a million columns. People tend to be better at scrolling rows of data because it is what they expect.. going horizontally.. um.. not as good HCI because it's unusual
 
Still thinking about this. Actually, I think that some users might want to edit the columns. It doesn't have to be limited to breakfast, lunch, and dinner. Maybe some people want to put in snacks, or whatever else. Different cultures might have different meal schedules. I'd like to leave those possibilities open.
 
I am thinking to have the columns set. 7 days for each day of the week. No one wants to see more than a week at a time anyway. People think in terms of weeks. So it's always 7 columns, but the number of rows would be flexible.

Is there a simple way to do this without a DataGridView? Something that would allow the user to add controls dynamically, for each meal?
 
Back
Top