I have a Grid that has a large number of columns, one for each day. There could be 100s of columns in this DataTable for those many days. After the DataTable is bound to the Grid, I am setting the width of each column as you see in the code snapshot.
I find it hard to understand why setting the Width is so expensive. It takes 24.86 compared to setting the Format on the next line which take only 0.003 . I found it hard to believe at first but repeated runs of C# profiler confirmed this inefficiency.
Is there a way I can avoid setting the column width one at a time. Is there Grid level or row level setting? Or some other suggestion?
Thanks!
I am on version 7.3
I can't imagine any reason why it should take that long to set the Width on 41 columns. Can you post a small sample project duplicating the problem?
@ Mike I am having the same Issue with the width property of a grid Column , I am using infragastics 14.1 and I am setting the width in code behind for 41 columns it is taking around 8 to 10 sec which is very expensive , I tried using BeginUpdate and EndUpdate , BeginInit and endInit. making the columns invisible and change width and make it visible nothing works.
Please provide me some suggestion for this issue with set of width property.
great idea! thanks!
Ok, thanks. I will try the latest release.I also noticed that if I set the columns to Hidden, resize them, then make them visible again, it works much faster.
Hi Campbell,
If you are still looking for a workaround....
Instead of setting width, I ended up using autosize method overload that decides based on the first x rows. That was a lot more performant than setting width. But we are still on 7.3. You may have better alternatives.