Hi.
I need to programatically insert rows and not use binding.
I have tried to do this:
for (int r = 0; r < Properties.Settings.Default.RowsPreviewCount && r < selectedDataTable.Rows.Count; r++)
{
Xceed.Wpf.DataGrid.DataRow xceedRow = new Xceed.Wpf.DataGrid.DataRow();
dataGridControl.Items.Add(xceedRow);
DataRow dataRow = selectedDataTable.Rows[r];
for (int i = 0; i < dataRow.StringData.Length; i++)
{
Xceed.Wpf.DataGrid.Cell cell = new Xceed.Wpf.DataGrid.Cell();
Label label = new Label();
label.Content = dataRow.StringData(i);
cell.Content = label;
xceedRow.Cells.Add(cell);
}
for (int i = 0; i < dataRow.NumericData.Length; i++)
{
Xceed.Wpf.DataGrid.Cell cell = new Xceed.Wpf.DataGrid.Cell();
cell.Content = dataRow.NumericData(i);
xceedRow.Cells.Add(cell);
}
}
But the Xceed DataGrid shows empty rows. I guess i'm doing something wrong.
If rows can't be programatically inserted is there a way to bind from two collections, like collection1 + collection2 must fit in a single row.
Thanks.