Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>GridView does not resize automatically.</p> <p>To resize the columns you can </p> <pre><code> foreach (GridViewColumn c in gv.Columns) { // Code below was found in GridViewColumnHeader.OnGripperDoubleClicked() event handler (using Reflector) // i.e. it is the same code that is executed when the gripper is double clicked // if (adjustAllColumns || App.StaticGabeLib.FieldDefsGrid[colNum].DispGrid) if (double.IsNaN(c.Width)) { c.Width = c.ActualWidth; } c.Width = double.NaN; } </code></pre> <p>As for sizing the last to fill area I do it with a converter. I don't think this converter does exactly what you need for this but it should get you started. </p> <pre><code> &lt;GridViewColumn Width="{Binding ElementName=lvCurDocFields, Path=ActualWidth, Converter={StaticResource widthConverter}, ConverterParameter=100}"&gt; [ValueConversion(typeof(double), typeof(double))] public class WidthConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { // value is the total width available double otherWidth; try { otherWidth = System.Convert.ToDouble(parameter); } catch { otherWidth = 100; } if (otherWidth &lt; 0) otherWidth = 0; double width = (double)value - otherWidth; if (width &lt; 0) width = 0; return width; // columnsCount; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } </code></pre> <p>GridView is fast but it takes a bit of baby sitting.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload