>I am missing something I think.
>
>If the row is not visible, then why would you want the content of any column in that row to affect the resizing?
Clay, maybe I''m missing something. I''m calling ColWidths.ResizeToFit() for all columns. I don''t care about the row in question. I want to resize the width of the columns based on their content.
But, the way the GridRowColSizeIndexer.ResizeToFit() fit works, when resizing the COLUMNS, it checks to see if a ROW is hidden. If the ROW is hidden, it uses the current width of the cell as the temporary "width" variable which is then used to decide the minimum width for that entire column. If the ROW isn''t hidden, it calls QueryPreferredClientSize, which in this case is returning a smaller width than the current column width. But since, for hidden rows, it''s using the current column width, I can''t resize the column to a width less than the current width with ResizeToFit.
What should really be happening is the row, if hidden, should be ignore entirely. After all, if it''s hidden, it shouldn''t contribute to the ResizeToFit operation one way or the other, n''est pas?
I''ve attached an example. Run the app. Click "Toggle Row 2 Hide". This will hide the second row in the grid. Now click "Resize To Fit". Notice the 3rd column does not resize smaller. Now click "Toggle Row 2 Hide" again so that the second row is no longer hidden and click "Resize To Fit", and now the 3rd column resizes down properly.
Pete
GridResizeToFitBug_6019.zip