Hi,
There is a XamDataGrid with superheaders in the my application. When i tried to copy data from it, i got the message "The selection must be rectangular..." Is there a way to copy data from table like it:
I'm not sure what the superheaders have to do with it. Basically that error message means that you have cells selected but you don't have the same fields selected in every row.
I created the simply test solution and got the same result. Without a superheader it works fine. There are empty collapsed cells into the grid. I saw it with "Snoop". My test solution is below
<igDP:XamDataGrid x:Name="xGrid">
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings
AutoGenerateFields="False"
AllowClipboardOperations="Copy"
CopyFieldLabelsToClipboard="False"
AutoArrangeCells="Never" />
</igDP:XamDataGrid.FieldLayoutSettings>
</igDP:XamDataGrid>
public MainWindow()
{
InitializeComponent();
DataTable table = new DataTable();
table.Columns.Add("Column1", typeof(string));
table.Columns.Add("Column2", typeof(string));
table.Rows.Add(new object[] { 100, 1000 });
FieldSettings fs = new FieldSettings() { CellClickAction = CellClickAction.SelectCell };
FieldLayout layout = new FieldLayout();
Field field = new Field("Column1", "Column1") { Row = 1, Column = 0, Settings = fs };
layout.Fields.Add(field);
field = new Field("Column2", "Column2") { Row = 1, Column = 1, Settings = fs };
field = new UnboundField()
Column = 0,
Row = 0,
ColumnSpan = 2,
Label = "Superheader",
Settings = new FieldSettings() { CellContentAlignment = CellContentAlignment.LabelOnly }
};
xGrid.FieldLayouts.Add(layout);
xGrid.DataSource = table.DefaultView;
}