Skip to content

Creating a schedule similar to sunbirt/outlook ....

K N

Asked Apr 20, 2010, 8:59 PM EDT1 answer
Share
LinkedInX
VB.NET
Hey guys,
I'm working on an windows application for an institute, let me elaborate a bit,
It gets the hours for classes (7-8:30, 9-10:30 ...) and also number of classrooms ( 1, 2, ....) then using these two collection of data I want to create a schedule like Sunbird, I have hours and classrooms therefore there is a vertical column (classrooms) and horizontal columns (hours).
what I have in mind is to create a 2*2 matrix and each cell will have id and that way I can check the status of it, but how can i display it visually ? I can't use datagridview, and this is dynamic so I can't pre-define the cells.
what do you suggest for this ?
I'm open to new suggestions, maybe you've got a better idea than I do.

	
see we have the hours (which is taken form one table) and class rooms ( which is taken from another table)
so I dunno how many I'm going to have, I guess I have to get these values from the user then dynamically create a new table with these info.

regards,
K1

here's a picture : http://img28.imageshack.us/img28/6143/classschedule.jpg[^]

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    You can do this with a list-view, filling out the columns dynamically. You'll need to put the 'view' property to 'details'. I do something similar in my code below. The only thing is that I'm not certain if a list view allow you to select any cell or only column zero. The latter is the default behavior and I haven't checked if their is a property to change this.

    The fact that your data is updated dynamically doesn't prevent you from using a datagridview, though. You can always build a new datatable dynamically and re-source based on an event. I have an application where I change the datagridview source table based on a groupbox selection.



    lview_recipeList.Clear();
                        lview_recipeList.Columns.Add("Recipe ID");
                        lview_recipeList.Columns.Add("Description");
                       
                        foreach (KeyValuePair<string, string> _recipe in _recipes){   
                            string _id         = _recipe.Key.ToString();
                            string _desc    = _recipe.Value.ToString();
                            ListViewItem item = new ListViewItem(new string[] {_id,_desc});               
                            lview_recipeList.Items.Add(item);
                        }
    0