In some situations the sort is triggered when resizing a column #676

Closed
opened 2026-01-29 17:41:24 +00:00 by claunia · 4 comments
Owner

Originally created by @rdkleine on GitHub (Dec 12, 2022).

Describe the bug
In some situations when resizing a column in the DataGrid the release of the mousebutton triggers a sorting of the column.

To Reproduce
Steps to reproduce the behavior:

  1. Go to demo page https://blazor.radzen.com/datagrid-column-reorder
  2. Horizontally scroll the grid to the right.
  3. Resize the column Extension untill the mousecursor is above the text Extension.
  4. Release mousebutton
  5. Notice that the Exension column is sorted.

Expected behavior
The column Extension columns shouldn't be sorted by a mouseup event.

Screenshots
resize-column-sorts-column

Desktop (please complete the following information):

  • Windows 10
  • Chrome
  • Latest version

Additional context
Couldn't find it (will digg a bit deeper) but it seems that the mouseup event for the column sort doesn't inspect if the sender is the same as the mousedown event sender.

Originally created by @rdkleine on GitHub (Dec 12, 2022). **Describe the bug** In some situations when resizing a column in the DataGrid the release of the mousebutton triggers a sorting of the column. **To Reproduce** Steps to reproduce the behavior: 1. Go to demo page https://blazor.radzen.com/datagrid-column-reorder 2. Horizontally scroll the grid to the right. 3. Resize the column Extension untill the mousecursor is above the text Extension. 4. Release mousebutton 5. Notice that the Exension column is sorted. **Expected behavior** The column Extension columns shouldn't be sorted by a mouseup event. **Screenshots** ![resize-column-sorts-column](https://user-images.githubusercontent.com/3634357/207069686-80d824cc-5d55-4d48-9698-6f716ab014c2.gif) **Desktop (please complete the following information):** - Windows 10 - Chrome - Latest version **Additional context** Couldn't find it (will digg a bit deeper) but it seems that the mouseup event for the column sort doesn't inspect if the sender is the same as the mousedown event sender.
Author
Owner

@dmarijanovic commented on GitHub (Mar 9, 2023):

This bug is still present in 4.7.8

My quick solution was to track ColumnResized and LoadData event time triggering.

<RadzenDataGrid LoadData="@LoadData" ColumnResized="@(_ => lastResizeEvent = DateTime.Now)" >

@code {
    private DateTime? lastResizeEvent;

    private async Task LoadData(LoadDataArgs args)
    {
            if (lastResizeEvent.HasValue && (DateTime.Now - lastResizeEvent.Value).Seconds < 1)
                return;
    }
@dmarijanovic commented on GitHub (Mar 9, 2023): This bug is still present in 4.7.8 My quick solution was to track ColumnResized and LoadData event time triggering. ``` <RadzenDataGrid LoadData="@LoadData" ColumnResized="@(_ => lastResizeEvent = DateTime.Now)" > @code { private DateTime? lastResizeEvent; private async Task LoadData(LoadDataArgs args) { if (lastResizeEvent.HasValue && (DateTime.Now - lastResizeEvent.Value).Seconds < 1) return; } ```
Author
Owner

@johanpolak commented on GitHub (May 15, 2023):

@akorchev We still experience this problem in the datagrid, can this be fixed?

@johanpolak commented on GitHub (May 15, 2023): @akorchev We still experience this problem in the datagrid, can this be fixed?
Author
Owner

@johanpolak commented on GitHub (Aug 8, 2023):

@enchev I just tried the new version of the package and the problem still exists. Can it be reopened?

@johanpolak commented on GitHub (Aug 8, 2023): @enchev I just tried the new version of the package and the problem still exists. Can it be reopened?
Author
Owner

@DSJDeveloper commented on GitHub (Sep 14, 2023):

@enchev The same thing happens when a column is dynamically fixed, the event that sorts the data is triggered.

@DSJDeveloper commented on GitHub (Sep 14, 2023): @enchev The same thing happens when a column is dynamically fixed, the event that sorts the data is triggered.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#676