Working with treegrid is not easy.
I am working on registering/editing/deleting a menu list with treegrid, and I would like to ask you a few questions.
1. If you set mode = "Batch", newposition = "Below", select one row and add it, the row is added, but the cell is not in Edit state.
(When working with a regular Grid, when you add, the mouse cursor is waiting for input within the cell.)
2. If you double-click a cell to edit it in question 1 above, an Error appears.
3. When the value of a specific cell changes, I want to change the value of other cells in the row.
4. I want to edit with Single Click.
5. When changing the EditTemple to CheckBox, can you confirm that the Grid has also changed if the CheckBox state is changed?
6. In batch mode, is there a way to check only the modified items when saving?
7. Is it necessary to use EnableVirtualization="true"?
Looking at most test sources, I saw that there was no EnableVirtualization="true" property, and the part that fetched data was executed in OnInitializedAsync(). However, I first search in OnAfterRenderAsync() and, if necessary, search with the search button, but without EnableVirtualization="true", the search does not work.
That is all.
(The source below is a test source with settings similar to the source I am working on.)
------ source ------
Hi Junghwi,
Query 1, 2: if you set mode = "Batch", newposition = "Below", select one row and add it, the row is added, but the cell is not in Edit state. (When working with a regular Grid, when you add, the mouse cursor is waiting for input within the cell.)
We have logged the problem “Adding not working when using Batch mode" as bug. We are working on a fix for this issue and plan to include it in our upcoming patch release, which is currently scheduled for Jun, 26 2024.
You can track the progress of the resolution by visiting the feedback link provided below:
Feedback link: https://www.syncfusion.com/feedback/58426/adding-not-working-when-using-batch-mode
Disclaimer: Inclusion of this
solution in the weekly release may change due to other factors including but
not limited to QA checks and works reprioritization.
Query 2: I want to edit with Single Click.
To achieve your requirement, we
suggest using the cellSelected event in TreeGrid. This event triggers
after a cell is selected, which in turn calls the EditCell method. We
have attached the code snippet and a modified sample for reference.
Ug link: https://blazor.syncfusion.com/documentation/treegrid/how-to/single-click-editing-with-batch-mode?cs-save-lang=1&cs-lang=razor
|
<SfTreeGrid .. > <TreeGridPageSettings PageSize="100"></TreeGridPageSettings> <TreeGridSelectionSettings Mode="Syncfusion.Blazor.Grids.SelectionMode.Both"></TreeGridSelectionSettings> <TreeGridEvents CellSelected="CellSelectHandler" OnActionComplete="Grid_Menu_Complete" TValue="Order"></TreeGridEvents> <TreeGridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Batch" NewRowPosition="Syncfusion.Blazor.TreeGrid.RowPosition.Below"></TreeGridEditSettings> … </SfTreeGrid> { //get selected cell index var CellIndexes = await obj_Grid_Menu.GetSelectedRowCellIndexesAsync();
// // Get the selected cell index // var rowIndex = args.RowIndex; // var columnIndex = args.CellIndex;
//get the row and cell index var CurrentEditRowIndex = CellIndexes[0].Item1; var CurrentEditCellIndex = (int)CellIndexes[0].Item2;
//get the available fields var fields = await obj_Grid_Menu.GetColumnsAsync(); // edit the selected cell using the cell index and column name await obj_Grid_Menu.EditCellAsync(CurrentEditRowIndex, fields[CurrentEditCellIndex].Field); } |
Query 3: When changing the EditTemple to
CheckBox, can you confirm that the Grid has also changed if the CheckBox state
is changed?
We have checked the EditTemplate using the checkbox
column, and it is working fine.
Query 4: In batch mode, is there a way to check
only the modified items when saving?
To achieve your requirement, we suggest to use the OnBatchSave event in TreeGrid. This event triggers after a batch save click and returns the changed records. We have attached the code snippet and modified sample for reference.
|
<SfTreeGrid >
<TreeGridEvents OnBatchSave="BatchSaveHandler" TValue="Order"></TreeGridEvents> … </SfTreeGrid> { // Here you can customize your code } |
Query 5: Is it necessary to use
EnableVirtualization="true"?
We have checked the shared
sample, and it is not necessary to set EnableVirtualization to true because the
sample renders a manageable amount of records. Also, we verified that searching
works fine on our end. If you are still facing issues, please share the sample
with replication steps, and we will provide further details.
Query 6: When the value of a specific cell
changes, I want to change the value of other cells in the row.
To achieve your requirement, we suggest using the OnCellSave
event in TreeGrid. This event triggers after a cell is saved, allowing other
columns to be modified based on specific conditions. We have attached a code
snippet and a modified sample for reference.
|
<SfTreeGrid >
<TreeGridEvents OnCellSave="CellSaveHandler" TValue="Order"></TreeGridEvents> … </SfTreeGrid> { // Here you can customize your code if(args.Data != null) { args.Data.Use_yn = false; } } |
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Index459940017.zip
If you have any further concerns or questions, please don't hesitate to reach
out to us. We are here to assist you.
Regards,
Ajithkumar G
hi.
How is the fixing of the bug registered as feedback above progressing?
Also, the version I have is version 24.2.3. If it is modified, will that version also be reflected? (There are no plans to upgrade to a higher version within this year)
Hi Junghwi,
Sorry for the inconvenience.
Unfortunately, we were unable to include the fix for the issue ” Exception thrown when we try to click on the edit form in batch mode” as promised due to some internal complexities. We are working on this issue with high priority. We will include the fix in our upcoming weekly patch release, which is expected to be rolled out on July 16th, 2024. Until then we value your patience.
We will provide the bug fix in the latest version only. We will try to provide a custom patch with the mentioned version. In case of any issues with this version, we will provide the latest version fix.
Regards,
Pon selva
Hi Junghwi,
Thanks for your patience.
The reported
issue occurred because the cell value not updated
because of fiedlname not matches with ErrorResult. We are
glad to announce that fix for the issue
“
Exception thrown when we
try to click on the edit form in batch mode” has been
rolled out in our weekly Nuget release. So,
upgrade to our latest version(26.1.42) of Syncfusion Nuget to resolve the
reported issue. Find the Nuget for latest fixes and features from below.
Nuget : https://www.nuget.org/packages/Syncfusion.Blazor.TreeGrid
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp_(3)-1156422981
Release note: https://blazor.syncfusion.com/documentation/release-notes/26.1.42?type=all#tree-grid
Kindly get back to us for further assistance.
I'm glad it's been fixed.
However, the license we have is version 24.2.3, and we are not planning to renew it until this year. Is there no way to apply the bug fixes?
Hi Junghwi,
As per your request, we are generating the custom patch on your reported version (24.2.3). We will share the custom patch on or before 24 July 2024. Until then we appreciate your patience.
Regards,
Shek
Hi Junghwi,
We have prepared the custom patch on the mentioned version (24.2.3). Please refer to the following custom NuGet.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/NuGet-1182346365
Kindly use the above NuGet to overcome your issue.
Regards,
Shek