Dear team,
Is there a way to resizing column after render component without click on column then move , but by pass the value to the width for column after render
Dear team,
Is there a way to resizing column after render component without click on column then move , but by pass the value to the width for column after render
for example I have code js calc the rezoluation screen height, width
the goal for got rezoluation screen height:
1- I want to fix padding for columns when change rezoluation for screen and it fits all screens without adding padding for columns
2- also I want to expand rows for grid In proportion to the screen size to display the largest possible number of rows with
by adding scroll virtical for grid without scroll for page
The issue, when using code js for get rezoluation screen height and width
the data of height, width were got after render component,
therefor can't pass this value to width column for grid
The only way to set the Width of a column is via its Width property. You can use JS interop to pass a value calculated on the client side. Something like:
<RadzenDataGridColumn Width="@columnWidth" ... />
@code {
string columnWidth = "200px";
[JSInvokable]
public void OnSetWidth(double width)
{
columnWidth = $"{width}px";
StateHasChanged();
}
}
where can invoke js?
Check the Blazor documentation that I have linked.