Hello,
I am trying to replicate a "Copy selected row" on a webdatagrid.
I have a WebDataGrid with Selection behavior enabled and RowSelectType set to "Single". When the user selects any of the rows, I want to offer the possibilty of duplicating the contents of the selected row by "copy-paste" like functionality (i.e. "Ctrl C" to copy contents and then "Ctrl + V" to paste the contents elsewhere).
I want to highlight the selected row in some different way than a normal row selection, so the user is aware that the contents of that row are the ones being copied, and that it is not a normal selection of a row.
I need to do this from client side.
Googling around, I've reached the conlusion that I have to change the SelectedRowSelectorCssClass of the Selection behavior dynamically through Javascript, and I got to the point below, but it does not work.
Do you know how can I change the SelectedRowSelectorCssClass dynamically from client/Javascript?
.DefaultSelectCSSClass { background-color: Blue; background-image:none; color:Black; } </style>
function CopyWebImageButton_Click(oButton, oEvent) {
var webGrid = $find("MyWebDataGrid");
webGrid.get_behaviors().get_selection()._selectedRowSelectorCss = "CopyHighlightCSSClass";
// Rest of copy logic
...
}
function PasteWebImageButton_Click(oButton, oEvent) {
webGrid.get_behaviors().get_selection()._selectedRowSelectorCss = "DefaultSelectCSSClass";
Hello Greale,
Thank you for posting in our community. This is possible with the latest version of our controls 2011 Vol2.
Please follow this sample code for more details:
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Editing-and-Selection/Clipboard/Default.aspx?cn=data-grid&sid=2ab1fa81-31ff-47c8-bfb9-ed3349e3e441
For any further questions do not hesitate to contact me.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Did you have a chance to review the sample in our samples browser?
For any further questions do not hesitate to contact me, I would be glad to help.