Clear AutoFitAllColumnsAsync settings, allow to mantain widths settled on the columns

1 Answer 81 Views
Grid
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Claudio asked on 19 Jul 2022, 07:28 AM

I have a Grid, for each column i set the width setting the property

Width="@DescriptionWidth"

When the grid is not in filter mode (FilterMode = GridFilterMode.None) i call AutoFitColumnsWidthAsync to autofit the columns.

When it is in filter mode i would like to have a bigger column size to allow the filter render correctly,

so i set the DescriptionWidth property who is binded to the Width of the column, but it not work if previously was called AutoFitColumnsWidthAsync.

 

There is a way to clear the settings done by AutoFitColumnsWidthAsync and allow to keep the binded property width?

Here a sample code:

https://blazorrepl.telerik.com/wmYrFDYh20r6bnFB33

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Jul 2022, 07:50 AM

Hi Claudio,

You will need to recreate the Grid in this scenario. After you execute AutoFitColumnsWidthAsync(), the columns no longer allow width changes via the Grid declaration.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 21 Jul 2022, 09:22 AM

Thanks
Tags
Grid
Asked by
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or