I have a schedule which needs to be shown in datagridview cell
-
Saturday, May 05, 2012 10:55 AM
I have a schedule which needs to be shown in data grid view cell. and according to time duration cell needs to be colored.
how can i start? please anyone help me. i am new in C #. would be helpful to start thanks.
All Replies
-
Saturday, May 05, 2012 1:24 PM
Where do you have a schedle now? Where are the data now?
You can loop through rows of data, and add it manually, easier (it you have data in some generic list, or datatable) would be bind the data straight to dgv.
Please, tell us more what you have now.
Mitja
-
Monday, May 07, 2012 12:09 PM
Thanks for replay.
My schedule data is in table. how can i range dgv cell according to my schedule start and end time. and according to time deference cell will be colored. thanks give me some suggestions.
-
Wednesday, May 09, 2012 9:53 AMModeratorHi MD. Imran Hasan
What do you mean by I have a schedule which needs to be shown in data grid view cell?
Are you trying to create a schedule DataGridView column or you want to create a schedule control by using data grid view?
Anyway, you can use a Timer to compare the current time and the date in the cell, then set the backcolor of the cell according to the compare result.
I think the following links would help.
http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/48ea6120-1f9d-454c-a188-c825010192ad
If there is anything unclear, please let us know.
Best Regards,Bob Wu [MSFT]
MSDN Community Support | Feedback to us
-
Sunday, May 13, 2012 4:54 AM
Thanks for your help.
actually i need a view in datagridview. which will show my schedule (Production schedule). In that schedule there are number of machines. in a machine a number of jobs take place which have start time and end time. according to time duration different color will be shown in dgv. just like the image bellow.
my schedule information (data) is in database.
-
Monday, May 14, 2012 8:00 PM
Thanks for your help.
actually i need a view in datagridview. which will show my schedule (Production schedule). In that schedule there are number of machines. in a machine a number of jobs take place which have start time and end time. according to time duration different color will be shown in dgv. just like the image bellow.
my schedule information (data) is in database.
Hello, I think it would be a good idea to show the structure of the table or tables from your database used to obtain this schedule which will assist with anyone looking to help youKSG
-
Tuesday, May 15, 2012 1:52 PMModerator
I agree with Kevin and I think you need to merge cells and do custom paint according to the data in the DataTable.
Here are some links about this topic.
http://www.codeproject.com/Articles/315015/WinForms-Grid-with-Merged-Cells
http://social.msdn.microsoft.com/Forums/en/winforms/thread/07071c24-d0c4-4952-8e53-fe0d2bf20641
If the issue is not solved, could you please give more details, such as the the structure of the table, the way you save schedule information ?
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Friday, June 08, 2012 5:43 AM


