See attached sample + video: http://www.screencast.com/t/76izqzD8F
The alert and general behavior is entirely up to your code. You need the latest build to make this work though – it will upload this evening.
with Wisej 220.127.116.11 I had to add this code to MyDataGrid.cs so that the keys CTRL+C were recognized from the control.
protected override bool IsInputKey(Keys keyData)
if (keyData == (Keys.Control | Keys.C))
Otherwise the override ProcessDialogKey was never executed.
You don’t need to handle OnTopLeftHeaderClick unless you want to disable the SelectAll().
Ctrl-C (or Ins) put the content in the wisej-managed clipboard on the server. You can handle it using the standard Clipboard object, on the server. It is impossible for ajax calls to put anything in the browser’s (client’s) clipboard.
There are two techniques to put content in the browser’s clipboard, one is to use a hidden (out of the viewport) textarea, put in the text, select it, and call execCommand(“copy”), another is not use a flash object. Both techniques fail if invoked from an ajax call. They work only if triggered by a user click – the user click may invoke an ajax action but it must be synchronous (which is deprecated in chrome) and a bad idea.
The only other approach I can think of is to add a method to the Clipboard class that allows you to programmatically move content to the client in a “temporary” clipboard, and then when Ctrl-C is processed on the client it can move it to the browser’s clipboard. That would mean that when a user selects rows your code has to decide if to immediately transfer the content to the client.
Another approach (widely used) is for your app to popup a box (or show/enable a copy button) asking the user to click to copy the content.
I’ll see if I can create a test case and share it here.
Thanks. I can now select all cell without writing any code with the new default event TopLeftHeaderClick (WJ-7584).
But can’t understand what is WJ- 7585 for and how it works. Tried Ctrl-C in a DGV with all cells selected, opened Excel, and got nothing after Ctrl-V. Am I doing it right? Is this related to 7566 above?
7564 – In my opinion, it is better to handle it by default. But it’s your call. I just brought to your attention that in Winform, it’s handled by default. In fact, you can just even click on any cell and drag your mouse to select columns and rows.
7566 – Yes, GetClipboardContent() is working but what I was saying is doing it manually. After pressing Ctrl-C (copy) in Winform, you can open Notepad, Excel, SublimeText, etc. and do a Ctrl-V (paste). It would be great if same functionality can be implemented, but if not, so be it.
Thank you for the list.
For 7563, all the autosizing modes for rows and columns are not implemented yet. Actually they mostly are, but not “hooked”.
7564, the intention was to simply implement SelectAll and let the application manage the top left click. But we can do the opposite and handle the event by default and if an app needs to disable it has to override the handler.
7566, the selected row in wisej will always include the row header as a full row select. The way the data is copied to the clipboard is controlled by the ClipboardCopyMode property. The method to get the clipboard data object is GetClipboardContent(), it sets the data object to CSV, HTML, Unicode and Text.
7562 – ShowColumnVisibilityMenu: if set to false and horizontal scrollbar is moved to the right, the column headers and datarows are messed up. Not Fixed.
7563 – RowHeaderWidthSizeMode:
7564 – Clicking on top-left most cell in DGV is not available. It should select all cells for copy and paste. Still have to attach to an event using SelectAll(). Not Fixed.
7566 – SelectAll(). It selects row headers and all data cells but not column headers. In WinForm, only data cells are selected. Partially Fixed (See attached)
7567 – Right align the row editing and new icons, and replace the cursor icon. Not Fixed
Using Build 18.104.22.168.
Thank you for the list, please see below:
Either attaching to CellMouseDown, or CellClick or CellDoubleClick or overriding the On handlers:
if (e.RowIndex == -1 && e.ColumnIndex == -1) this.dataGridView1.SelectAll();
4. I tried it and it seems to work well. The path is Appearances\ScrollBar\Default\Properties\Width:
5. WJ-7567: It’s actually a good idea and a much easier implementation in theme if we always use only 1 icon right-aligned. Now it has a complex css with the :after pseudo element to have two icons. But if you are editing, there is no need for the cursor icon. It’s a lot cleaner with a single state icon.
6. The row header cell is a cell like any other, it’s part of the row and it moves with the row.