This is a migrated thread and some comments may be shown as answers.

Problems with GridView

3 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 23 Dec 2015, 08:41 AM

Hi, while recently my company has officially bought software from you and, thus, I suppose has a support agreement, I want to post this to a general forum. Here are the issues I encountered with GridControl:

1) Select a cell in the grid, then select an entire row and then do any Ctrl+ / Shift+ command. This causes the selection to switch to one column selection only, which spans the old cell and the newly selected row in one way or another. Also the grid loses focus. I suppose that we could catch key presses and deal with them as we wish, but this default behaviour seems very strange. 

2) Cut functionality (Ctrl-X) seems to not copy anything onto the clipboard. Shouldn't Cut behave exactly the same way as Copy (except that Cut removes cells contents and Copy does not)?

3) Adding new row functionality. If you double-click on the corner cell (on the cell with the "+" sign, located to the left of the "Click here to add new item" label), the grid contents disappears completely. Then you click a number of times on that "+" cell. Then you click out of it (anywhere on any blank cell). Then you see that you get N empty rows, where N is the number of clicks you did altogether. This seems to have been intended, however, I personally think it is very confusing. Is there a way to disable this behaviour?

4) This, I believe, is a genuine bug in the control! When you Copy over the hidden cells and then Paste, you can control the Paste behaviour using SkipHiddenColumns attribute. However, if you copy cells spanning hidden cells using Ctrl key (i.e. you are copying individual cells rather than a subsequent region of cells), Paste does something very weird: it adds empty hidden cells to the selection.

Here is an example of what I mean:

- grid

columns           A    B   C   D

values-row1     1    2    3    4

values-row2     5    6    7    8

- column B is hidden

 

Scenario 1:

   - copy 1 and 3 as a subsequent region of cells (it would be subsequent, since column B is hidden)

   - paste into the beginning of row2

   - if SkipHiddenColumns=false,1 and 3 are pasted instead of 5 and 6

   - if SkipHiddenColumns=true,1 and 3 are pasted instead of 5 and 7

 

Scenario 2:

   - copy 1 and 3 as two separate cells using Ctrl keyboard key

   - paste into the beginning of row2

   - if SkipHiddenColumns=false,1 and 3 are pasted instead of 5 and 7 (WHY???)

   - if SkipHiddenColumns=true,1 and 3 are pasted instead of 5 and 8 (WHY???) -- this is the worst!

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Dec 2015, 09:08 AM
Hello Alexander,

My answers will follow the order of your questions: 
1. My guess would be that you are working with SelectionUnit="Mixed" since you select a cell and then a row. I tested the behavior on our demos, but I was not able to reproduce it. Could you check this small video to verify whether I am following the exact steps? (My last action is to press Ctrl+C).
2. Currently, RadGridView does not support cut command out-of-the-box. What you can try is to create your own command and execute it on Ctrl+X. Check out the "Keyboard Command Provider" article for a reference.
3. I tried to reproduce the behavior but without any success. Could you check out this small video to see whether my attempt is following the required steps?
4. Unfortunately, I am not able to reproduce this as well, but I might be missing something. Here is my attempt. 
I attached my small sample project that I used for testing. Could you try getting the same behavior on it and let me know the steps I need to follow? 


Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alexander
Top achievements
Rank 1
answered on 18 Jan 2016, 06:15 AM

Hi, Maya. Thank you for your reply. I took some time investigating issues, and also our development has moved along during this time... Anyway, the issues.

1. This issue happens on your demo version as well. I recorded a video - http://www.screencast.com/t/Aa6vx2Jn . Here is what I did (Selection & Usability -> Selection demo): mouse-select the cell "Elizabeth Lincoln", then mouse-select the entire third row by clicking to the left of the row (the row with "ANTON" in the first cell), then press SHIFT & ARROW-DOWN on the keyboard. It selects the subsequent third column cells from "Thomas Hardy" (in the third row) to "Elizabeth Lincoln" (the cell I had selected initially). What I expect, however, is to have two entire rows selected: third and fourth (with "ANTON" and "AROUT" in first cells).

2. Understood about Cut. What confused me is the documentation for http://www.telerik.com/help/winforms/p_telerik_wincontrols_ui_radgridview_clipboardcutmode.html, for example... Cut works strangely anyway, as it blanks only the first cell out of the entire selection (leaving it blank). We disabled CTRL-X for now.

3. We are not using data to directly populate cells, as our data is complex. It's all virtualised, and we are implementing add behaviour ourselves now, without using built-in "Click here to add new item" functionality.

4. I cannot replicate this problem now either. The grid properly ignores hidden cells both when copying and pasting. I guess the problem was with me playing with grid settings (ClipboardPasteMode="Cells,OverwriteWithEmptyValues,SkipHiddenColumns" so far seems to be working properly).

In summary, issue #1 among the ones I mentioned seems to be the only real issue now.

0
Maya
Telerik team
answered on 20 Jan 2016, 12:52 PM
Hi Alexander,

I investigated the first issue and indeed, it seems a bit unexpected. We will log the item to research whether this can be improved without introducing breaking changes. In the meantime, I prepared a small project illustrating a workaround.
Considering the second issue, the link you posted targets WinForms, while I guess that you are working with WPF.  
As for the third issue, I am not quite sure that I should suggest since I understood from the first post that you are have NewRowPosition property set. Am I missing anything ? 
 

Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Maya
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or