<Grid> <Dxg:gridcontrolName= "Griderrorsinfo"Autopopulatecolumns= "True"Showborder= "False"Showloadingpanel= "False"HorizontalAlignment= "Stretch"VerticalAlignment= "Stretch"allowcolumnmrufilterlist= "False"allowmrufilterlist= "False"Margin= "0,0,4,28"MouseDoubleClick= "Griderrorsinfo_mousedoubleclick"> <Dxg:GridControl.Columns> <Dxg:gridcolumnName= "Num"FieldName= "Num"Header= "NUM"Width= "+"/> <Dxg:gridcolumnName= "PageName"FieldName= "PageName"Header= "Name"Width= "Max"/> <Dxg:gridcolumnName= "Errors"FieldName= "Errordetail"Width= "Auto"Header= "Megs"/> </Dxg:GridControl.Columns> <Dxg:GridControl.View> <Dxg:tableviewName= "Errorviewlist"Autowidth= "True"Allowmovecolumntodroparea= "False"/> </Dxg:GridControl.View> </Dxg:gridcontrol></Grid>
<dxg:GridControl.View> <dxg:tableview name= "errorviewlist" autowidth= "True" Allowmovecolumntodroparea= "False"/></dxg:gridcontrol.view>
The most important of the above code is the above two sentences.
<DataGridAutoGenerateColumns= "False"Height= " the"HorizontalAlignment= "Left"Margin= "2,5,0,0"Name= "Datachartsingle"VerticalAlignment= "Top"Width= "225"isreadonly= "True"> <Datagrid.columns> <DatagridtextcolumnHeader= "Varnumber"Binding="{Binding VarName}"Width= "The "Canusersort= "False"canuserresize= "True"/> <DatagridtextcolumnHeader= "Maxvar"Binding="{Binding Varmax}"Width= "$"Canusersort= "False"canuserresize= "True" /> <DatagridtextcolumnHeader= "Minvar"Binding="{Binding Varmin}"Width="*"Canusersort= "False"canuserresize= "True" /> </Datagrid.columns> </DataGrid>
In the DataGrid is a good solution, just to the last column in the Width setting, set to Width= "*" The last column will be filled automatically.
There is always one more blank line behind a grid in WPF