Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
Copy/paste from locked grid
posted

Hello Infragistics

I have an Ultragrid i lock the following way:

 pUltraGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
 pUltraGrid.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;
pUltraGrid.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False;
pUltraGrid.EventManager.SetEnabled(GridEventIds.ClickCellButton, false);
pUltraGrid.DisplayLayout.Override.CellClickAction = CellClickAction.RowSelect;
pUltraGrid.DisplayLayout.ViewStyleBand = ViewStyleBand.Horizontal;

It is important to me to have the grid set to RowSelect, because I need the selected row in certain scenarious. 

I want to implement code that makes it possible to copy/paste values from cells, by clicking the cell and use CTRL+C on the keyboard. This is not possible with RowSelect. 

I then tried chaning it to CellSelect, and the it works. This gives me the problem with the selected row. When I click a cell Active Row gets changed but the Selected Row does not. For me this seems like a bug in the UltraGrid? In the GUI you can also see the arrow on the first line, at the same time a cell in another row is selected (highlighted). 

Do you have any idea on how to solve this task?

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Rasmus,

    I have been investigating into this behavior that you are looking to achieve, and currently it is not possible to use the built-in Ctrl+C operations to copy cell values without actually selecting the cells, specifically. As such, I would have to recommend that you use the CellClickAction as "CellSelect."

    For actual row selection, you could use the RowSelector functionality of the UltraGrid, which is turned on by default. The RowSelector is the small column, usually to the left side of the grid that displays an arrow when clicked. When clicked, this will select the row.

    Alternatively, if the case is that you only need a single selected row at a particular time, why not consider usage of the ActiveRow property of the UltraGrid? This will essentially return the row that is "focused" and so when you select a cell in a particular row, that row will become the ActiveRow.

    The active row getting changed while the selected row does not is not a bug in the UltraGrid. In order for the SelectedRow to change, a row needs to actually be selected. With the CellClickAction set to CellSelect, this will only happen when using the RowSelector or another operation that perhaps you create through application code that manually selects the row. The row can still become active, though, for the reasons mentioned above.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data