I've had to override the default menus for individual cells in the application being developed, the design department wanted to keep the functionality of the copy and paste functionality of the original, since I've overriden the context menu this is no longer using the default menus provided by Telerik.
Of course I've created the menus in the context menu created, wired up the event handler for the copy menu and for some reason the clipboard just isn't retaining the data. Here is the code to copy:
double cellValue = Convert.ToDouble(radGridView.CurrentRow.Cells[radGridView.CurrentColumn.Index].Value);
Clipboard.SetDataObject(cellValue);
The menu is only available in columns of type GridViewDecimalColumns, hence the Convert.ToDouble on getting the value.
Pasting is done a similar way:
IDataObject iData = Clipboard.GetDataObject();
if (iData.GetDataPresent(DataFormats.Text))
radGridView.CurrentRow.Cells[radGridView.CurrentColumn.Index].Value =
Convert.ToDouble(iData.GetData(DataFormats.Text));
However neither method works, copy or paste. The functionality is simple, copy a cell - paste a value. Data needs to be able to copied to other programs like Excel, Word, etc. Clipboard is available on the system, code does not error out, but for some reason the value is just not there.
Any assistance would be appreciated. Thank you in advance.
Of course I've created the menus in the context menu created, wired up the event handler for the copy menu and for some reason the clipboard just isn't retaining the data. Here is the code to copy:
double cellValue = Convert.ToDouble(radGridView.CurrentRow.Cells[radGridView.CurrentColumn.Index].Value);
Clipboard.SetDataObject(cellValue);
The menu is only available in columns of type GridViewDecimalColumns, hence the Convert.ToDouble on getting the value.
Pasting is done a similar way:
IDataObject iData = Clipboard.GetDataObject();
if (iData.GetDataPresent(DataFormats.Text))
radGridView.CurrentRow.Cells[radGridView.CurrentColumn.Index].Value =
Convert.ToDouble(iData.GetData(DataFormats.Text));
However neither method works, copy or paste. The functionality is simple, copy a cell - paste a value. Data needs to be able to copied to other programs like Excel, Word, etc. Clipboard is available on the system, code does not error out, but for some reason the value is just not there.
Any assistance would be appreciated. Thank you in advance.