This is a migrated thread and some comments may be shown as answers.

Date Format

4 Answers 32 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
HUYJIN
Top achievements
Rank 1
HUYJIN asked on 04 Jun 2018, 09:05 AM

Hi~

Can I set task date format "yyyyMMdd"

don't use hhmmss

ganttview_ItemChanged(object sender, GanttViewItemChangedEventArgs e)

{

    e.Start = new DateTime(e.Start.Year, e.Start.Month, e.Start.Day);

 

}

 

4 Answers, 1 is accepted

Sort by
0
HUYJIN
Top achievements
Rank 1
answered on 04 Jun 2018, 09:13 AM

 e.End = new DateTime(e.End.Year, e.End.Month, e.End.Day, 23,59,59);

but not paint

I move it by day

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Jun 2018, 01:31 PM
Hello,   

In order to specify the format of a certain column in the text view, you can directly set the FormatString property of the desired column: 
this.radGanttView1.Columns[1].FormatString = "{0:yyyy.MM.dd}";

Here is the result for the "Start" column:



I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
HUYJIN
Top achievements
Rank 1
answered on 05 Jun 2018, 12:49 AM

 Dess, Thank you

but I used it yet.

 I make work calendar

I hope Same Start and End Date

for example your answer

Sub-task.2  Start Date = 2010.10.12 , End Date = 2010.10.12 23h:59Mm:59s

Sub-task.2 Drag 1Day and 12h (14h -> 1day, 2day 14h -> 3day)

I hope set 2 Day use ItemChangedEvent to Change date

Sub-task.2  Start Date = 2010.10.14  , End Date = 2010.10.14 23h:59Mm:59s

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Jun 2018, 08:54 AM
Hello,   

The start/end of the tasks are of DateTime types. Hence, it contains the date part together with the time part no matter how you set the properties actually. In the columns you can specify the format how the DateTime value will be displayed. If you need to add a task that is a whole day, it is important to specify the time part as well as below: 

GanttViewDataItem subitem11 = new GanttViewDataItem();
subitem11.Start = new DateTime(2010, 10, 10, 0, 0, 0);
subitem11.End = new DateTime(2010, 10, 10, 23, 59, 59);

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GanttView
Asked by
HUYJIN
Top achievements
Rank 1
Answers by
HUYJIN
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or