Skip to content

Commit 79a6581

Browse files
982290: Part 2 - Check code snippet and make preview sample in blazor platform
1 parent ad505a3 commit 79a6581

File tree

2 files changed

+14
-67
lines changed

2 files changed

+14
-67
lines changed

blazor/gantt-chart/context-menu.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The following sample code demonstrates defining a custom context menu item and i
100100
private SfGantt<TaskData> Gantt;
101101
private List<ContextMenuItemModel> contextMenuItems = new List<ContextMenuItemModel>()
102102
{
103-
new ContextMenuItemModel(){Text="Refresh", Target=".e-content",Id="refresh"}
103+
new ContextMenuItemModel(){Text="Refresh", Target=".e-content",Id="Refresh"}
104104
};
105105
protected override void OnInitialized()
106106
{
@@ -236,7 +236,7 @@ The following sample code demonstrates defining the sub-context menu item and it
236236
private SfGantt<TaskData> Gantt;
237237
private List<ContextMenuItemModel> contextMenuItems = new List<ContextMenuItemModel>()
238238
{
239-
new ContextMenuItemModel{Text="GanttAction",Target=".e-content",Id="GanttAction",
239+
new ContextMenuItemModel{Text="Gantt Action",Target=".e-content",Id="GanttAction",
240240
Items=new List<MenuItem>(){new MenuItem {Text="Refresh",Id= "Refresh"},new MenuItem {Text="Edit",Id= "Edit"} } }
241241
};
242242

@@ -390,7 +390,7 @@ The following sample code demonstrates how to enable or disable context menu ite
390390
private SfGantt<TaskData> Gantt;
391391
private List<ContextMenuItemModel> contextMenuItems = new List<ContextMenuItemModel>()
392392
{
393-
new ContextMenuItemModel{Text="GanttAction",Target=".e-content",Id="GanttAction",
393+
new ContextMenuItemModel{Text="Gantt Action",Target=".e-content",Id="GanttAction",
394394
Items=new List<MenuItem>(){new MenuItem{Text="Refresh",Id="Refresh"},new MenuItem{Text="Edit",Id= "Edit"}}}
395395
};
396396

blazor/gantt-chart/drag-and-drop.md

Lines changed: 11 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Event Name |Description
130130
131131
In Gantt, the `OnRowDragStart` and `RowDropped` events are triggered on row drag and drop action. Using this event, you can prevent dragging of particular record, validate the drop position, and cancel the drop action based on the target record and dragged record. The following topics explains about this.
132132
133-
Prevent dragging of particular record
133+
Prevent dragging of particular record
134134
135135
You can prevent drag action of the particular record by setting the `Cancel` property to `true`, which is available in the `OnRowDragStart` event argument based on our requirement. In the following sample, drag action was restricted for first parent record and its child records.
136136
@@ -166,69 +166,16 @@ You can prevent drag action of the particular record by setting the `Cancel` pro
166166
public int Progress { get; set; }
167167
public int? ParentID { get; set; }
168168
}
169-
public static List <TaskData> GetTaskCollection() {
170-
List <TaskData> Tasks = new List <TaskData> () {
171-
new TaskData() {
172-
TaskID = 1,
173-
TaskName = "Project initiation",
174-
StartDate = new DateTime(2019, 03, 28),
175-
EndDate = new DateTime(2019, 07, 28),
176-
Duration="4"
177-
},
178-
new TaskData() {
179-
TaskID = 2,
180-
TaskName = "Identify Site location",
181-
StartDate = new DateTime(2019, 03, 29),
182-
Progress = 30,
183-
ParentID = 1,
184-
Duration="2",
185-
},
186-
new TaskData() {
187-
TaskID = 3,
188-
TaskName = "Perform soil test",
189-
StartDate = new DateTime(2019, 03, 29),
190-
ParentID = 1,
191-
Duration="4"
192-
},
193-
new TaskData() {
194-
TaskID = 4,
195-
TaskName = "Soil test approval",
196-
StartDate = new DateTime(2019, 03, 29),
197-
Duration = "4",
198-
Progress = 30,
199-
ParentID = 1
200-
},
201-
new TaskData() {
202-
TaskID = 5,
203-
TaskName = "Project estimation",
204-
StartDate = new DateTime(2019, 03, 29),
205-
EndDate = new DateTime(2019, 04, 2),
206-
Duration="4",
207-
},
208-
new TaskData() {
209-
TaskID = 6,
210-
TaskName = "Develop floor plan for estimation",
211-
StartDate = new DateTime(2019, 03, 29),
212-
Duration = "3",
213-
Progress = 30,
214-
ParentID = 5
215-
},
216-
new TaskData() {
217-
TaskID = 7,
218-
TaskName = "List materials",
219-
StartDate = new DateTime(2019, 04, 01),
220-
Duration = "3",
221-
Progress = 30,
222-
ParentID = 5
223-
},
224-
new TaskData() {
225-
TaskID = 8,
226-
TaskName = "Estimation approval",
227-
StartDate = new DateTime(2019, 04, 01),
228-
Duration = "2",
229-
ParentID = 5
230-
}
231-
};
169+
public static List<TaskData> GetTaskCollection() => new List<TaskData> {
170+
new TaskData { TaskID = 1, TaskName = "Project initiation", StartDate = new DateTime(2019, 03, 28), EndDate = new DateTime(2019, 07, 28), Duration = "4" },
171+
new TaskData { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 03, 29), Progress = 30, ParentID = 1, Duration = "2" },
172+
new TaskData { TaskID = 3, TaskName = "Perform soil test", StartDate = new DateTime(2019, 03, 29), ParentID = 1, Duration = "4" },
173+
new TaskData { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 03, 29), Duration = "4", Progress = 30, ParentID = 1 },
174+
new TaskData { TaskID = 5, TaskName = "Project estimation", StartDate = new DateTime(2019, 03, 29), EndDate = new DateTime(2019, 04, 2), Duration = "4" },
175+
new TaskData { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 03, 29), Duration = "3", Progress = 30, ParentID = 5 },
176+
new TaskData { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 04, 01), Duration = "3", Progress = 30, ParentID = 5 },
177+
new TaskData { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 04, 01), Duration = "2", ParentID = 5 }
178+
};
232179
return Tasks;
233180
}
234181
}

0 commit comments

Comments
 (0)