rowselected change on click aditional option in toolbar after upgrade 27.1.53
hi,
i updated from 27.1.48 to 27.153 and I observed a strange behavior when clicking an option in the toolbar in addition to the standard ones
If I select a record from the grid, and then navigate through the additional menu of the toolbar to each option selection, the grid change selected row to the first record
i see that if attribute SelectedRowIndex is assigned occurs this problem, but not if not exists
this is part definition Grid toolbar
<SfGrid @ref="Grid" TValue="DepartmentDto" AllowPaging="true" AllowFiltering="true" AllowSorting="true" RowHeight="30" Width="90%" SelectedRowIndex="0"
Toolbar="@(new List<Object>() { "Add", "Edit", "Delete", "Update", "Cancel",
new ItemModel() { Type = ItemType.Separator },
new ItemModel() { Type = ItemType.Button, Template = AditionalOps2}
})">
AditionalOps2 is:
private RenderFragment AditionalOps2 =>
@<div>
<SfDropDownButton @ref="btnFuncs" Id="btnFileMenu" Content="Funciones" CssClass="e-dropDown-button">
<ChildContent>
<DropDownButtonEvents OnClose="@DropDownButtonClose"></DropDownButtonEvents>
</ChildContent>
<PopupContent>
<SfContextMenu @ref="ContextMenu" Items="FuncsMenuItems" TValue="ContextMenuItemModel" ShowItemOnClick="true">
<MenuFieldSettings Text="Content"></MenuFieldSettings>
<MenuEvents TValue="ContextMenuItemModel" OnClose="BeforeClose" Created="OnMenuCreated" ItemSelected="Selected"></MenuEvents>
</SfContextMenu>
</PopupContent>
</SfDropDownButton>
</div>
;
thank's in advance
Hi Sergio Cabello,
Based on the reported problem, "When the first row in the grid gets
selected by default, it might explain why the selected row resets to the first
record when interacting with your toolbar." To proceed with addressing
this issue, we require some additional clarification from you. Please provide
the following details to help us move forward:
- What specific actions did you perform when selecting an option from the SfContextMenu?
- Could you please share a video demonstrating the issue?
- To analyze the reported issue, could you please share a simple and reproducible sample that demonstrates the problem? This will assist us in identifying the issue more efficiently and providing a resolution.
- Or kindly share your attempt to replicate the issue using the attached simple sample.
Above-requested details will be very helpful in validating the reported query at our end and providing a solution as early as possible. Thanks for your understanding.
Regards,
Prathap Senthil
hi Prathap,
run the link sample that you remited
select a row other than the first, and click button "Funciones", the row selected change to first row. this is the problem
remove the atribute SelectedRowIndex="0"
and try the behavior is normal not change the selected row
We have considered it as a bug and logged an issue “Selection is inconsistent when used with SelectedRowIndex” for the same. Thank you for taking the time to report this issue and helping us to improve our product. At Syncfusion, we are committed to fix all validated defects (subject to technological feasibility and Product Development Life Cycle) and this fix will be included in our upcoming patch release which is expected to be rolled out on or before 29th October 2024.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
https://www.syncfusion.com/feedback/62382/selection-is-inconsistent-when-used-with-selectedrowindex
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”
Until then we appreciate your patience.
Thanks
for your patience,
We are glad to announce that, we have included the fix for the issue “Selection is inconsistent when used with SelectedRowIndex” in our 27.1.57 release. So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the NuGet package for latest fixes and features from below.
NuGet : https://www.nuget.org/packages/Syncfusion.Blazor.Grid
Root Cause: The issue occurs because, when a row is clicked, the private _selectedRowIndex property is updated in the SelectByRow() method. When the grid's parent component refreshes due to an event binding, the grid's OnHybridParametersSet() method is triggered. If !SfBaseUtils.Equals(SelectedRowIndex, _selectedRowIndex), the property changes are detected and updated. As a result, in the OnAfterRenderAsync() method, the SelectRow() method is called, and the SelectedRowIndex value provided in the sample is updated.
Corrective
Actions Taken:
The issue was resolved by preventing the call to SelectRow() using
the _rowIndexPropertyChanged property. This was done by checking the
request type is not delete, ensuring that the SelectRow() method is
only called when necessary.
We thank you for your support and appreciate your patience in waiting for this release.
- 4 Replies
- 2 Participants
-
SC Sergio Cabello
- Oct 16, 2024 07:01 AM UTC
- Oct 30, 2024 04:35 AM UTC