The XtraGrid provides two built-in column resizing modes: manual and automatic. You can choose one using the GridView.OptionsView.ColumnAutoWidth property. However, in Auto mode the horizontal scrollbar is never enabled. This is a problem if columns are reduced to their minimum width and still don't fit into the view's client area. Also, a column width can be changed only relative to other columns, while manual mode lacks the useful stretching functionality when the control itself is resized.
This example demonstrates how to implement functionality similar to the one provided by ColumnAutoWidth mode and solve its drawbacks in user code.
Question Comments
Added By: Mabaega Eg at: 2/25/2016 1:33:34 AM Thank you , this example is very useful for me .
and some questions....
How to make this to auto RecalcWidths after Best Fit (All Column) ContextMenu Clicked?
Is there a way to turn this into CustomControl ?
Thank.Added By: Nadezhda (DevExpress Support) at: 2/25/2016 4:28:02 AM
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: How to catch a click on a menu item. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.