Skip to main content
All docs
V22.2
  • CRXPF0009 - AutoWidth and relative column width are used together

    Severity: Error

    The analyzer detects that you use relative (star) values to specify a column’s Width property, and the TableView.AutoWidth or TreeListView.AutoWidth property is set to true. In this case, the GridControl does not apply relative column widths.

    Examples

    Invalid Code

    <dxg:GridControl ...>
        <dxg:GridControl.View>
            <dxg:TableView AutoWidth="True" .../>
        </dxg:GridControl.View>
        <dxg:GridColumn FieldName="FieldName1" Width="3*"/>
        <dxg:GridColumn FieldName="FieldName2" Width="2*"/>
        <dxg:GridColumn FieldName="FieldName3" Width="*"/>
        <!-- ... -->
    </dxg:GridControl>
    

    Valid Code

    <dxg:GridControl ...>
        <dxg:GridControl.View>
            <dxg:TableView AutoWidth="False" .../>
        </dxg:GridControl.View>
        <dxg:GridColumn FieldName="FieldName1" Width="3*"/>
        <dxg:GridColumn FieldName="FieldName2" Width="2*"/>
        <dxg:GridColumn FieldName="FieldName3" Width="*"/>
        <!-- ... -->
    </dxg:GridControl>
    

    How to Fix

    Set the TableView.AutoWidth or TreeListView.AutoWidth property to false if you use relative (star) values to specify a column’s Width property.

    Refer to the following help topic for more information: Resize Columns in Code.