.net - Remove the blank column in a WPF DataGrid -


i use dataset populate datagrid in wpf (c#). result is:

enter image description here

i want remove blank column @ left side. , want share remaing space columns. expected result is:

enter image description here

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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -