Skip to content

Commit c6778c1

Browse files
committed
chore: apply review recommendations
1 parent 41e8601 commit c6778c1

File tree

9 files changed

+45
-36
lines changed

9 files changed

+45
-36
lines changed

components/gantt/gantt-tree/editing/incell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To control whether a newly added item appears at the top or bottom of the Gantt
2424

2525
The `NewRowPosition` parameter accepts values from the `GanttTreeListNewRowPosition` enum:
2626

27-
- `Top` (default)Inserts the new item at the top of the view.
28-
- `Bottom`Inserts the new item at the bottom of the view.
27+
- `Top` (default)—Inserts the new item at the top of the view.
28+
- `Bottom`—Inserts the new item at the bottom of the view.
2929

3030
### Note
3131
It is up to the data access logic to save the data once it is changed in the data collection, or to revert changes. The example above showcases the events that allow you to do that. In a real application, the code for handling data operations may be entirely different.

components/gantt/gantt-tree/editing/inline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ To control whether a newly added item appears at the top or bottom of the Gantt
2626

2727
The `NewRowPosition` parameter accepts values from the `GanttTreeListNewRowPosition` enum:
2828

29-
- `Top` (default)Inserts the new item at the top of the view.
30-
- `Bottom`Inserts the new item at the bottom of the view.
29+
- `Top` (default)—Inserts the new item at the top of the view.
30+
- `Bottom`—Inserts the new item at the bottom of the view.
3131

3232
>caption The Command buttons and the Gantt events let you handle data operations in Inline edit mode.
3333

components/gantt/gantt-tree/editing/overview.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,21 @@ This configuration is available in InCell and Inline edit modes. For more detail
306306

307307
> When you set `NewRowPosition` to `Bottom`, add the new item at the end of your data collection in the `OnCreate` event handler. When set to `Top`, insert the new item at the beginning of the collection. This ensures the new row appears in the correct position in the view after successfully creating the new record.
308308
309-
>caption Example of adding a new item based on the `NewRowPosition` value:
309+
>caption Example of adding a new item to the Gantt based on the `NewRowPosition` value
310310
311311
<div class="skip-repl"></div>
312312
````C#
313-
if (NewRowPosition == GanttTreeListNewRowPosition.Bottom)
313+
private void OnCreate(GanttCreateEventArgs args)
314314
{
315-
dataCollection.Add(newItem);
316-
}
317-
else // Top
318-
{
319-
dataCollection.Insert(0, newItem);
320-
}
315+
if (NewRowPosition == GanttTreeListNewRowPosition.Bottom)
316+
{
317+
dataCollection.Add(newItem);
318+
}
319+
else // Top
320+
{
321+
dataCollection.Insert(0, newItem);
322+
}
323+
}
321324
````
322325

323326
## Example

components/grid/editing/incell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ You can control whether a newly added item appears at the top or bottom of the G
6060

6161
The `NewRowPosition` parameter accepts values from the `GridNewRowPosition` enum:
6262

63-
- `Top` (default)Inserts the new item at the top of the view.
64-
- `Bottom`Inserts the new item at the bottom of the view.
63+
- `Top` (default)&mdash;Inserts the new item at the top of the view.
64+
- `Bottom`&mdash;Inserts the new item at the bottom of the view.
6565

6666
For a complete example of how this feature works, see the following [example](slug:grid-editing-incell#basic).
6767

components/grid/editing/inline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ You can control whether a newly added item appears at the top or bottom of the G
4545

4646
The `NewRowPosition` parameter accepts values from the `GridNewRowPosition` enum:
4747

48-
- `Top` (default)Inserts the new item at the top of the view.
49-
- `Bottom`Inserts the new item at the bottom of the view.
48+
- `Top` (default)&mdash;Inserts the new item at the top of the view.
49+
- `Bottom`&mdash;Inserts the new item at the bottom of the view.
5050

5151
## Integration with Other Features
5252

components/grid/editing/overview.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,21 @@ This configuration is available in InCell and Inline edit modes. For more detail
214214

215215
> When you set `NewRowPosition` to `Bottom`, add the new item at the end of your data collection in the `OnCreate` event handler. When set to `Top`, insert the new item at the beginning of the collection. This ensures the new row appears in the correct position in the view after successfully creating the new record.
216216
217-
>caption Example of adding a new item based on the `NewRowPosition` value:
217+
>caption Example of adding a new item to the Grid based on the `NewRowPosition` value
218218
219219
<div class="skip-repl"></div>
220220
````C#
221-
if (NewRowPosition == GridNewRowPosition.Bottom)
221+
private void OnCreate(GridCommandEventArgs args)
222222
{
223-
dataCollection.Add(newItem);
224-
}
225-
else // Top
226-
{
227-
dataCollection.Insert(0, newItem);
228-
}
223+
if (NewRowPosition == GridNewRowPosition.Bottom)
224+
{
225+
dataCollection.Add(newItem);
226+
}
227+
else // Top
228+
{
229+
dataCollection.Insert(0, newItem);
230+
}
231+
}
229232
````
230233

231234
## Examples

components/treelist/editing/incell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ You can control whether a newly added item appears at the top or bottom of the T
6060

6161
The `NewRowPosition` parameter accepts values from the `TreeListNewRowPosition` enum:
6262

63-
- `Top` (default)Inserts the new item at the top of the view.
64-
- `Bottom`Inserts the new item at the bottom of the view.
63+
- `Top` (default)&mdash;Inserts the new item at the top of the view.
64+
- `Bottom`&mdash;Inserts the new item at the bottom of the view.
6565

6666
## Integration with Other Features
6767

components/treelist/editing/inline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ You can control whether a newly added item appears at the top or bottom of the T
4545

4646
The `NewRowPosition` parameter accepts values from the `TreeListNewRowPosition` enum:
4747

48-
- `Top` (default)Inserts the new item at the top of the view.
49-
- `Bottom`Inserts the new item at the bottom of the view.
48+
- `Top` (default)&mdash;Inserts the new item at the top of the view.
49+
- `Bottom`&mdash;Inserts the new item at the bottom of the view.
5050

5151
## Integration with Other Features
5252

components/treelist/editing/overview.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,21 @@ This configuration is available in InCell and Inline edit modes. For more detail
200200

201201
> When you set `NewRowPosition` to `Bottom`, add the new item at the end of your data collection in the `OnCreate` event handler. When set to `Top`, insert the new item at the beginning of the collection. This ensures the new row appears in the correct position in the view after successfully creating the new record.
202202
203-
>caption Example of adding a new item based on the `NewRowPosition` value:
203+
>caption Example of adding a new item to the TreeList based on the `NewRowPosition` value
204204
205205
<div class="skip-repl"></div>
206206
````C#
207-
if (NewRowPosition == TreeListNewRowPosition.Bottom)
207+
private void OnCreate(TreeListCommandEventArgs args)
208208
{
209-
dataCollection.Add(newItem);
210-
}
211-
else // Top
212-
{
213-
dataCollection.Insert(0, newItem);
214-
}
209+
if (NewRowPosition == TreeListNewRowPosition.Bottom)
210+
{
211+
dataCollection.Add(newItem);
212+
}
213+
else // Top
214+
{
215+
dataCollection.Insert(0, newItem);
216+
}
217+
}
215218
````
216219

217220
## Examples

0 commit comments

Comments
 (0)