XamDataGridで選択されている行を取得するには、XamDataGridのSelectedItemsのRecordsプロパティを参照してください。選択されている行のDataRecordオブジェクトのコレクションが取得できます。
foreach(DataRecord dr in xamDataGrid1.SelectedItems.Records)
{
foreach(Cell cell in dr.Cells)
{
System.Diagnostics.Debug.Write(cell.Value.ToString());
if(dr.Cells.IndexOf(cell) < dr.Cells.Count - 1) System.Diagnostics.Debug.Write(", ");
}
System.Diagnostics.Debug.WriteLine("");
}
サンプル
APIリファレンス
- SelectedItems プロパティ