wpf 中Grid后面总是多一空白行
2021-04-20 14:28
标签:lte cal move pop data border ret width table 在DataGrid里面就很好解决了,只需要在最后一列里面的width设置时,设置为 Width="*" 最后一列就会自动填充满。 wpf 中Grid后面总是多一空白行 标签:lte cal move pop data border ret width table 原文地址:https://www.cnblogs.com/hllxy/p/8617460.html Grid>
dxg:GridControl Name="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:GridColumn Name="Num" FieldName="Num" Header="NUM" Width="100"/>
dxg:GridColumn Name="PageName" FieldName="PageName" Header="Name" Width="150"/>
dxg:GridColumn Name="Errors" FieldName="ErrorDetail" Width="Auto" Header="Megs"/>
dxg:GridControl.Columns>
dxg:GridControl.View>
dxg:TableView Name="ErrorViewList" AutoWidth="True" AllowMoveColumnToDropArea="False"/>
dxg:GridControl.View>
dxg:GridControl>
Grid>
上面代码里面最主要的就是上面的这两句。DataGrid AutoGenerateColumns="False" Height="190" HorizontalAlignment="Left" Margin="2,5,0,0" Name="dataChartSingle" VerticalAlignment="Top" Width="225" IsReadOnly="True">
DataGrid.Columns>
DataGridTextColumn Header="VarNumber" Binding="{Binding VarName}" Width="130" CanUserSort="False" CanUserResize="True"/>
DataGridTextColumn Header="MaxVar" Binding="{Binding VarMax}" Width="48" CanUserSort="False" CanUserResize="True" />
DataGridTextColumn Header="MinVar" Binding="{Binding VarMin}" Width="*" CanUserSort="False" CanUserResize="True" />
DataGrid.Columns>
DataGrid>
文章标题:wpf 中Grid后面总是多一空白行
文章链接:http://soscw.com/index.php/essay/77171.html