I am facing trouble in RadGridView's width which gets increased when I add dynamic columns and their column group headers as per business requirement and at run time only I am removing dynamically added columns and column group headers but the width of the RadGridView never decreased and it does not look good of having grid without any columns on right hand side with horizantol scroll bar.
I hope someone will support me on this trouble.
6 Answers, 1 is accepted
I have tested controlling the visibility of the columns using the IsVisible property for the column and the width for the GridView was recalculated fine. Do you add/remove the columns or do you just show/hide them in the GridView? Have you tested this with the latest version?
the Telerik team
I am adding columns and Column Groups dynamically (at run time) and removing dynamic Columns and column groups at run time as well. So once I remove dynamic columns and column groups it does not decrease RadGridView width accordingly which I set Auto in .xaml file and Grid column which is parent contaier for Rad grid view also has width="Auto".
Please help me to solve this issue.
I was not able to reproduce the issue. Please find attached my test project for a reference. May I ask you to change it to show your case?All the best,
the Telerik team
I am not only adding dynamic columms but Column Groups as well and removing dynamic columns and columns group as run time as per business requirement. After my R & D I found that once I removed dynamic columns and column groups I must use call UpdateLayout() method of the grid. like following.
the last line solves the issue.
I have checked the provided stack trace, and it seems that you are using a web component. This forum is related to UI for WPF. May I ask you to share which Grid component are you using so that I can transfer your question to the correct team.
Our thoughts here at Progress are with those affected by the outbreak.