.net - Remove the blank column in a WPF DataGrid -
i use dataset populate datagrid in wpf (c#). result is:
i want remove blank column @ left side. , want share remaing space columns. expected result is:
my xaml code is:
<window x:class="rfid.careerwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="careerwindow" height="356" width="404"> <grid> <datagrid x:name="dg1" horizontalalignment="left" margin="25,10,0,0" verticalalignment="top" height="306" width="355" enablerowvirtualization="false" enablecolumnvirtualization="false" fontfamily="2 badr" fontsize="20" flowdirection="righttoleft" canuseraddrows="false" canuserreordercolumns="false"/> </grid> </window>
avoid setting static height , width.
use columnwidth="*"
share space between datagridcolumns
<datagrid x:name="dg1" columnwidth="*" horizontalalignment="left" verticalalignment="top" margin="25,10,0,0" enablerowvirtualization="false" enablecolumnvirtualization="false" fontfamily="2 badr" fontsize="20" flowdirection="righttoleft" canuseraddrows="false" canuserreordercolumns="false" />
Comments
Post a Comment