DataGrid column resize issue => resize other columns too #894

Closed
opened 2026-01-29 17:45:54 +00:00 by claunia · 2 comments
Owner

Originally created by @Delriarh on GitHub (Jun 16, 2023).

Hey !

I have encountered an issue with DataGridColumn width...
I succeeded to reproduce it and found a way to avoid it...

  1. I created an Editable DataGrid with resizable columns, within a container large enough to contain all the columns => NO HORIZONTAL SCROLL BAR
  2. Width of all columns are initialized with Width="...px"
  3. I put the Edit button on the first column, with Frozen="true". The other columns are not frozen
  4. Therefore, when I want to resize a column, it changes the width of the others too, in order to adapt to the width of the DataGrid, without adding any horizontal scroll bar ! This is not what I excepted, as I just wanted to modify 1 column

Solution to avoid this issue : force the initial width of the columns, in order to get the HORIZONTAL SCROLL BAR at the creation of the DataGrid

Thanks for all the work you're doing here, it's very helpful !!

Regards
Erwan

Here is the options of my DataGrid (I tried with ColumnWidth, it was the same) :
<RadzenDataGrid @ref="xxx" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="true" FilterMode="FilterMode.Simple" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowSorting="true" PageSize="13" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" EditMode="DataGridEditMode.Single"
Data="@xxx" TItem="xxx" LogicalFilterOperator="LogicalFilterOperator.And" RowUpdate="@OnUpdateRow" Sort="@Reset" Page="@Reset" Filter="@Reset">

Originally created by @Delriarh on GitHub (Jun 16, 2023). Hey ! I have encountered an issue with DataGridColumn width... I succeeded to reproduce it and found a way to avoid it... 1) I created an Editable DataGrid with resizable columns, within a container large enough to contain all the columns => NO HORIZONTAL SCROLL BAR 2) Width of all columns are initialized with Width="...px" 3) I put the Edit button on the first column, with Frozen="true". The other columns are not frozen 4) Therefore, when I want to resize a column, it changes the width of the others too, in order to adapt to the width of the DataGrid, without adding any horizontal scroll bar ! This is not what I excepted, as I just wanted to modify 1 column Solution to avoid this issue : force the initial width of the columns, in order to get the HORIZONTAL SCROLL BAR at the creation of the DataGrid Thanks for all the work you're doing here, it's very helpful !! Regards Erwan Here is the options of my DataGrid (I tried with ColumnWidth, it was the same) : <RadzenDataGrid @ref="xxx" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="true" FilterMode="FilterMode.Simple" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowSorting="true" PageSize="13" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" EditMode="DataGridEditMode.Single" Data="@xxx" TItem="xxx" LogicalFilterOperator="LogicalFilterOperator.And" RowUpdate="@OnUpdateRow" Sort="@Reset" Page="@Reset" Filter="@Reset">
Author
Owner

@enchev commented on GitHub (Jun 19, 2023):

You need to specify style="width:XXXpx" if you want to get horizontal scrollbar after column resize.

@enchev commented on GitHub (Jun 19, 2023): You need to specify style="width:XXXpx" if you want to get horizontal scrollbar after column resize.
Author
Owner

@Ayymoss commented on GitHub (Jan 5, 2024):

It's still bugged, but it's problematic on the https://blazor.radzen.com/datagrid-column-resizing reference.

Note that the column's resize is travelling further than the cursor position, similarly resizing a column will resize the neighbour.

nxkg3g3

Better reference here: https://github.com/radzenhq/radzen-blazor/issues/1308

@Ayymoss commented on GitHub (Jan 5, 2024): It's still bugged, but it's problematic on the https://blazor.radzen.com/datagrid-column-resizing reference. Note that the column's resize is travelling further than the cursor position, similarly resizing a column will resize the neighbour. ![nxkg3g3](https://github.com/radzenhq/radzen-blazor/assets/4959320/704517f6-383a-40e6-8c66-57eb7adccf00) Better reference here: https://github.com/radzenhq/radzen-blazor/issues/1308
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#894