Hello, i do not know if that was a bug or done on purpose, but after render a datagridview, i will change the width of columns by code, it works perfectly, but if i change manualy (visual) a width, when i try to change again by code the width, the column that i change it manualy do not change with the code width but remain with the manual width.
That was a bug or exist some solution?
While we fix the issue, you can use a workaround:
Insert an extra line before setting the Width value you want, like this
((Wisej.Core.IWisejComponent)dataGridView1.Columns).Configuration.width = 0; dataGridView1.Columns.Width = 300;
here is a test sample that used in video, where i added an another button that set the width of the first column at 300.
if do as in the video, you can see this problem, after button click and change width with mouse, the second click on button don’t change the width visually.
if i first time change with mouse the width, hit one of the button it works, after that when change again with mouse and hit one of buttons is stop works, but, if i hit one button then the other it restart works, i can’t understand where is the problem, and why when i do in the for(columns) loop the column update it didn’t work but in the ColumnWidthChanged Event column update yes.
I hope i have expressed myself well
i tested and same problem, i registered a little video where show the problem, try to explain: the first time when use the mouse to change the width and after that hit the button it works, but after that (hitting the button) if change again with mouse the width and retray to hit the button it did not works, even if at the code level the width was changed.
I tryed to do DGV Refresh(), Update(), column update and nothing; but yesterday i will found i little solution that it would seem work, intercept the ColumnWidthChange Event, and here do a column Update().
I have tried this with a small sample (attached) but could not reproduce.
After starting the test app I resized the first column using the mouse and then hit the button.
It works ok.
Can you please check if these are the correct steps and provide some test code and a detailed description
how to reproduce the problem ?
Thanks in advance.
Please login first to submit.