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

Getting CellSelection object from mouse-selected cells

5 Answers 194 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Atif
Top achievements
Rank 1
Atif asked on 03 Oct 2013, 12:12 PM
Is it possible to get CellSelection object by selecting the cells using mouse. I need to store information (row and column index) of selected (using mouse) cells in another control.
i.e something like CellSelection cs = this.worksheet.Cells.SelectedCells();
Thanks.

5 Answers, 1 is accepted

Sort by
0
Anna
Telerik team
answered on 07 Oct 2013, 10:57 AM
Hi,

Thank you for your question!

Do you need to get only the selections done by mouse or just any selection present at the worksheet?

With the Selection object you will be able to get the selection of the worksheet no matter if it was made with code behind or by a mouse. You will need something similar to the following:
Selection selection = this.RadSpreadsheet.ActiveWorksheetEditor.Selection;
string selectionInfo = String.Empty;
foreach (CellRange range in selection.SelectedRanges)
{
    selectionInfo += range.FromIndex + " " + range.ToIndex;
    selectionInfo += Environment.NewLine;
}

The properties FromIndex and ToIndex are of type CellIndex from which you can easily get the information about the precise row and column index.

I hope this answers your question. If you have further questions regarding this or any other matter, you can always come back to us.

Regards,
Anna
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Marc
Top achievements
Rank 1
answered on 30 Nov 2016, 10:23 AM

Is there a way to do this using Kendo Spreadsheet Widget and AngularJS/jQuery? Getting the selected cell and storing in a variable is extremely important for me!

 

Thanks!

0
Alex Hajigeorgieva
Telerik team
answered on 02 Dec 2016, 11:01 AM
Hello Marc,

The Kendo UI Spreadsheet has a lot of enhancements planned for R1 2017 and I am glad to let you know that a  select event is one of them:

https://github.com/telerik/kendo-ui-core/issues/2409

On a side note, this forum is for the RadSpreadsheet for WPF. Please post any further questions regarding the Kendo UI Spreadsheet in this forum instead:

http://www.telerik.com/forums/kendo-ui/spreadsheet
(or submit a support ticket)

Sticking to this practice ensures that the best-trained colleagues for each product can see your question immediately and respond to you in the most time-efficient manner. 

Thank you very much in advance.

Kind Regards,
Alex Hajigeorgieva
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
0
Luis
Top achievements
Rank 1
answered on 11 Mar 2019, 05:15 PM
Hi Anna, I try this solution, i need apply the copy/paste function on my spreadsheet that contain merged cells, when select the cells that we want copy in others cells, appear a pop up that say: "Cannot change part of a merged cell." But doesn´t work.
0
Nikolay Demirev
Telerik team
answered on 13 Mar 2019, 06:23 AM
Hello Luis,

Your question has already been answered in the other thread https://www.telerik.com/forums/issue-with-nameconverter-convertrownametoindex(cell) you have opened on the same topic.

Please, see our answer there for more information.

Regards,
Nikolay Demirev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Spreadsheet
Asked by
Atif
Top achievements
Rank 1
Answers by
Anna
Telerik team
Marc
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Luis
Top achievements
Rank 1
Nikolay Demirev
Telerik team
Share this question
or