I have a fairly basic 3 band grid and I am doing auto resize of visible rows within InitializeLayout() handler (calling PerformAutoResize(PerformAutoSizeType.VisibleRows) for each column in the 2nd band) and then calling it again within BeforeRowExpanded so that newly expanded row cells get auto-resized. I noticed that PerformAutoResize(PerformAutoSizeType.VisibleRows) does not seem to resize the newly expanded row for whatever reason, the width of the cell is set to width of the column header (even though all data has been bound). However, as soon as I expand one of the other top level nodes within the grid, I see the width of the cells within the first expanded row change and become what it should have been when the row was expanded.
To me it looks like some sort of a 'refresh' issue however Application.DoEvents() does not seem to help. I am using NetAdvantage 2009 V2. Any input will be appreciated? Is this a known issue? Thanks.
Hello ,
Probably it is not very good approach to PerformAutoResize(PerformAutoSizeType.VisibleRows) in BeforeRowExpanded event, because in this event the rows are still hidden and auto size shouldn’t affect them. My suggestion is to call
ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(false, Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand, true);
Please try this suggestion and let me know for the result.
I think you might be right about child row(s) not being visible (yet ) within BeforeRowExpanded event handler however I cannot use AllRowsInBand argument as it takes 45 seconds to complete (my grid has a large number of visible columns so it takes forever to size all of them). Perhaps I can force activate the expanded child row and do resizing within the AfterRowActivate or should AfterRowExpanded event suffice in this case? Thanks.