-
Notifications
You must be signed in to change notification settings - Fork 79
docs(Grid): add docs for new row position feature #3096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,6 +298,27 @@ You can customize the editors rendered in the Gantt Tree by providing the `Edito | |
|
||
* `IsCanceled`- a boolean field indicating whether the operation is to be prevented. | ||
|
||
## New Row Position | ||
|
||
You can control whether a newly added item appears at the top or bottom of the Gantt Tree. Use the [`NewRowPosition`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.gantttreelistnewrowposition) parameter to specify the position. This parameter does not affect Popup edit mode, which always displays a dialog for new items. | ||
|
||
This configuration is available in InCell and Inline edit modes. For more details, see the [Tree InCell Editing](slug:gant-tree-incell-editing#new-row-position) and [Tree Inline Editing](slug:gant-tree-inline-editing#new-row-position) articles. | ||
|
||
> 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. | ||
|
||
>caption Example of adding a new item based on the `NewRowPosition` value: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe your team avoids placing ending punctuation for captions. |
||
|
||
<div class="skip-repl"></div> | ||
````C# | ||
if (NewRowPosition == GanttTreeListNewRowPosition.Bottom) | ||
{ | ||
dataCollection.Add(newItem); | ||
} | ||
else // Top | ||
{ | ||
dataCollection.Insert(0, newItem); | ||
} | ||
```` | ||
|
||
## Example | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,28 @@ When editing a row with child items, it will collapse unless you override the `E | |
|
||
Learn more integration details for the [inline](slug:treelist-editing-inline#integration-with-other-features) and [in-cell](slug:treelist-editing-incell#integration-with-other-features) edit modes. | ||
|
||
## New Row Position | ||
|
||
You can control whether a newly added item appears at the top or bottom of the TreeList. Use the [`NewRowPosition`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.treelistnewrowposition) parameter to specify the position. This parameter does not affect Popup edit mode, which always displays a dialog for new items. | ||
|
||
This configuration is available in InCell and Inline edit modes. For more details, see the [InCell Editing](slug:treelist-editing-incell#new-row-position) and [Inline Editing](slug:treelist-editing-inline#new-row-position) articles. | ||
|
||
> 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. | ||
|
||
>caption Example of adding a new item based on the `NewRowPosition` value: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since these captions have become mostly identical, for SEO&LLM purposes, I recommend adding the component to the caption. For example |
||
|
||
<div class="skip-repl"></div> | ||
````C# | ||
if (NewRowPosition == TreeListNewRowPosition.Bottom) | ||
{ | ||
dataCollection.Add(newItem); | ||
} | ||
else // Top | ||
{ | ||
dataCollection.Insert(0, newItem); | ||
} | ||
```` | ||
|
||
## Examples | ||
|
||
See TreeList CRUD operations in action at: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, it's recommended to use the mdash without spaces around it.