I am using Datagrid in froms in Powershell to populate selected servers in to the Datagrid. i am adding data in to Datagrid using DataTable.
$dt = new-object System.Data.DataTable
$dt.columns.add("ServerName")
$dt.columns.add("Domain")
$dt.columns.add("UserName")
$dr = $dt.NewRow()
$dr.ServerName = "Server1"
$dr.Domain = "Domain1"
$dr.UserName = "username1"
$dataGrid1.DataSource = $dt
i am trying to select mulitple rows in the Datagrid and get values of selected rows from datagrid. i could not find any property "SelectedRows" in the DataGrid class other than CurrentRowIndex but it only gives current row not selected rows.
is there a way to get the selected rows and values in those rows from the datagrid?also i would like to see how to remove selected rows from Datagrid.
any help would be greatly appreciated.
Thank you
Vamsi.
$dt = new-object System.Data.DataTable
$dt.columns.add("ServerName")
$dt.columns.add("Domain")
$dt.columns.add("UserName")
$dr = $dt.NewRow()
$dr.ServerName = "Server1"
$dr.Domain = "Domain1"
$dr.UserName = "username1"
$dataGrid1.DataSource = $dt
i am trying to select mulitple rows in the Datagrid and get values of selected rows from datagrid. i could not find any property "SelectedRows" in the DataGrid class other than CurrentRowIndex but it only gives current row not selected rows.
is there a way to get the selected rows and values in those rows from the datagrid?also i would like to see how to remove selected rows from Datagrid.
any help would be greatly appreciated.
Thank you
Vamsi.