How can I get the number of records copied in clipboard?
It looks I can not use Infragistics.Windows.DataPresenter.ClipboardData directly.
Hello,
You can get them from the ClipboardCopying event and the GetSourceRecord method :
private void XamDataGrid_ClipboardCopying(object sender, Infragistics.Windows.DataPresenter.Events.ClipboardCopyingEventArgs e)
{
int copiedRecordsCount = e.RecordCount;
for (int i = 0; i < copiedRecordsCount; i++)
System.Diagnostics.Debug.WriteLine(e.GetSourceRecord(i));
}
I hope I want to know the record count at any time, not only when I copy the data. For example, before I paste data from clipboard.
Perhaps, you can use a local variable or property that will be set in this event - an attached property of the XamDataGrid or CLR property on the window.
But other application can change the clipboard content. So it is not useful to record the value.