I just started working with gantt view, so I have some questions
Can we include multiple projects in ultraGanttView?
I want to use a List as datasource, actually i am working like this
ultraCalendarInfoGanttView.DataBindingsForProjects.BindingContextControl = this; ultraCalendarInfoGanttView.DataBindingsForProjects.DataSource = new ProjectManager().GetProjects();ultraCalendarInfoGanttView.DataBindingsForTasks.BindingContextControl = this;ultraCalendarInfoGanttView.DataBindingsForTasks.DataSource = new TaskManager().GetTasks();
But I didn't get any data in view, please help me to figure out this.
Thanks for reply.
Hi,
I suppose that you are using ultraCalendarInfo1_AfterAppointmentAdded() event to update your database only for the fields that you bind to your UltraCalendarInfo. If you want to update your DB with data from your extra fields, just call update method of your TableAdapter (only for these fields) when you press a button from the win form that add a tasks.
mayank164 said: In database I have start date and end date not duration column,So how I show task by calculating duration?
If you have start and end date, so you could calculate the task`s duration. You could do this in your C# code or in your database. For example:
C# DateTime startDate = DateTime.Today; DateTime endDate = DateTime.Today.AddDays(10); TimeSpan diffDate = endDate.Subtract(startDate); MessageBox.Show("Days difference = "+ diffDate.Days.ToString()); SQL DECLARE @BegDate DATETIME DECLARE @EndDate DATETIME SET @BegDate = GETDATE() SET @EndDate = DATEADD(dd, 10, GETDATE()) PRINT DATEDIFF(dd, @BegDate,@EndDate) Let me know if you have any questions. Regards
C#
DateTime startDate = DateTime.Today;
DateTime endDate = DateTime.Today.AddDays(10);
TimeSpan diffDate = endDate.Subtract(startDate);
MessageBox.Show("Days difference = "+ diffDate.Days.ToString());
SQL
DECLARE @BegDate DATETIME
DECLARE @EndDate DATETIME
SET @BegDate = GETDATE()
SET @EndDate = DATEADD(dd, 10, GETDATE())
PRINT DATEDIFF(dd, @BegDate,@EndDate)
Let me know if you have any questions.
Regards
I'll explain you,I have a form to add task, in that form I have some extra field which do not allow null. I don't want that user enter value for field in gantt chart and there is no need to show in gantt chart so I didn't bind them with calendarInfo .now when user add task these fields also get initialized with some default data in datatable so I can insert task.
I think you understand.
I have one more query
In database I have start date and end date not duration column,So how I show task by calculating duration?
I`m not sure what is your scenario, but maybe you could handle ultraCalendarInfo1_AfterAppointmentAdded() event and using e.Appointment properties you could update your data table. I`m not sure where you are bind this table, but all available data in your UltraCalendarInfo will be represent in the UltraGanttView. Of course you could hide some columns from your task grid.
Let me know if you think that I misunderstood your scenario
Thanks,
This is alright.Also give the answers of second part of question
when task is added I want to initialize some columns with some values in data table only and don't want to show in tasks grid.