[SOLVED] More on DataGridView

Answered Closed
0
0

Hi Luca,

  1. ShowColumnVisibilityMenu – if set to false and horizontal scrollbar is moved to the right, the column headers and datarows are messed up. (Image 1 & 2).
  2. RowHeaderWidthSizeMode – setting it to any of the available values has no effect. I can resize even set to DisableResizing.
  3. Clicking on top-left most cell in DGV is not available. It should select all cells for copy and paste.
  4. Vertical ScrollBar – changing ScrollBar Appearances.ScrollBar.Default.Width value in Theme Builder has no effect at runtime.
  5. Row Number in Row Header – is covered with editing icon (pencil – image 3) and adding icon (+ – image 4). Is it possible to change alignment of these two icons to right-align like the table-row-indicator using the Theme Builder? I already tried but don’t know what Appearance to look for. Also, if I click in any of the column headers to sort, the Row Numbers disappear (image 5 & 6).

Thanks.

Attachment
  • You must to post comments
Best Answer
0
0

Hi Cris,

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.

Best,

Luca

Attachment
  • Dino Novak
    How can you also include column headers in clipboard contents? Tried with SelecAll(), SelectCells() but no luck
  • You must to post comments
0
0

Hi,

with Wisej 1.4.64.0 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))
{
return false;
}
return base.IsInputKey(keyData);
}

Otherwise the override ProcessDialogKey was never executed.

Jens

  • You must to post comments
0
0

Hi Luca,

Tried your sample and it works.

Build 1.2.62.0

Thanks.

  • You must to post comments
0
0

Hi Luca,

Thanks. I’ll appreciate it very much.

Regards.

  • You must to post comments
0
0

Hi Cris,

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.

Best,

Luca

 

  • You must to post comments
0
0

Hi Luca,

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?

Thanks.

  • You must to post comments
0
0

Hi Luca,

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.

Thanks.

  • You must to post comments
0
0

Hi Cris,

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.

Best,

Luca

  • You must to post comments
0
0

Hi Frank,

Sorry, I didn’t update my custom theme when testing last night. After re-testing:

  1. 7562 – fixed.
  2. 7563 – as noted above.
  3. 7564 – as noted above.
  4. 7566 – as noted above.
  5. 7567 – fixed.

Thanks.

  • You must to post comments
0
0

Hi Frank,

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:

  1. AutoSizeToAllHeaders: Not Fixed
  2. AutoSizeToDisplayedHeaders: Not Fixed
  3. AutoSizeToFirstHeader: Not Fixed
  4. EnableResizing: Fixed
  5. DisableResizing: Fixed

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 1.2.57.0.

Thanks

Attachment
  • You must to post comments
0
0

Hi Cris,

WJ-7562, WJ-7563, WJ-7566 and WJ-7567 are all fixed/added in the latest build (1.2.57).

Thanks !

Best regards
Frank

  • You must to post comments
0
0

Hi Luca,

4. You are right. I was in the right spot though. Changed the value and saved. But didn’t copy the theme file into the project’s Theme folder. I’m really smart!!

6. Got you.

 

  • You must to post comments
0
0

Hi Cris,

Thank you for the list, please see below:

  1. WJ-7562: Theme problem, the header panel doesn’t have the right padding to offset the scrollbar width.
  2. WJ-7563
  3. WJ-7566: This is not implemented by design: it’s easy to add and it avoids having to provide a property or an override to disable. One of the fundamental differences between Wisej and VWG is that we always fire all the events so there is no overhead to attach or override an event handler. The problem, however, is that our DGV doesn’t have a SelectAll() method. It will be added with the next update.

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.

Best,

Luca

  • You must to post comments
0
0

Hi,

I used 1.2.56.0 in my last test above.

Thanks.

  • You must to post comments
0
0

Hi,

5. Row Numbers in RowHeaderCell no longer disappear when sorting. However, the row numbers are also sorted, I believe, it should be the data row only as in Excel. Am I right?

Thanks.

Attachment
  • You must to post comments
Showing 15 results