wpf - Pre-Sort DataGrid Column in Powershell -


i trying pre-sort column in datagrid inside of powershell. have created datagrid xaml. populating datagrid datatable in powershell.

my current attempt:

$ui.datagrid.datacontext = $datacontext  $datacontext = $datatable.defaultview | sort-object -property 'property 1'  

however, when run this, datagrid filled unnecessary columns such as: row version, row, isnew, isedit, , error. have been looking property or method allows me sort in both datatable , datagrid objects. unfortunately, have been unable find either me in situation. have been reading bit on datagridview options. note: not datagridview, datagrid.


Comments