How can i dock a System.Windows.Controls.Data.DataGrid column to the right ?
hello, have datagrid stretches horizontally full width of page. defines 3 datagridtemplatecolumns . first datagridtemplatecolumn has fixed width, have third column dock right, , middle column stretched , fill remaining space. basically, need implement similar behaviour dockpanel. can advise me on how achieve this? thank you
ups - sorry
<data:datagrid x:name="datagrid" sizechanged="datagrid_sizechanged"> <data:datagrid.columns> <data:datagridtextcolumn header="one" width="100"/> <data:datagridtextcolumn header="two"/> <data:datagridtextcolumn header="three" width="100"/> </data:datagrid.columns> </data:datagrid>
private void datagrid_sizechanged(object sender, sizechangedeventargs e) { double colomnsize = datagrid.actualwidth - (datagrid.columns[0].width.value + datagrid.columns[2].width.value); datagrid.columns[1].width = new datagridlength(colomnsize); }maybe have subtract 2 colomn seperators
Silverlight > Silverlight Controls and Silverlight Toolkit
Comments
Post a Comment