devexpress-wpfdevexpress-gridcontrol

DevExpress GridColumn strange proportional sizing


I have created a GridControl with a few fixed width and 2 autowidth columns.

I have set the autowidth columns like this:

<dxg:GridColumn
  Width="2*" FieldName="Name"
  FixedWidth="False" Header="Name" />

<dxg:GridColumn
  Width="6*" FieldName="Subject"
  FixedWidth="False" Header="Subject" />

I intended to have a 2:6 proportion regarding the widths of those columns, so I set their Width to 6* and 2* as proportional values.

Strangely, the following happens.

When they are set to 6* and 2*:

enter image description here

When they are set to 5* and 2*:

enter image description here

Clearly, if the multiplier is below 6, it works as there are no multipliers (the columns fill equally the remaining space), but when it is over 5, the proportion goes mad and shrinks the lower multiplied column.

According to their support, it supports proportional settings.

How can I create a 6:2 proportion without setting a MaxWidth?


Solution

  • I suggest to set AutoWidth property of TableView to False, it should then work as expected. Also, I believe you don't need to set FixedWidth on columns (it only works in AutoWidth mode).

    Hope this helps!