spreadsheet

1 Answer 107 Views
Spreadsheet wrapper
Top achievements
Rank 1
Iron
asked on 07 Dec 2021, 03:57 AM
Hello, I would like to ask if there is a corresponding method to support me to obtain the data of selected rows or columns when using the spreadsheet

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 07 Dec 2021, 07:37 AM

Hello 三,

The methods you need to achieve the targeted functionality are the:

Here is a StackBlitz example demonstrating how using the above three methods, you can get the values of the currently selected cells inside the Spreadsheet. It is the below method that gets and prints the selected values in the browser's console. 

getSelection() {
	const spreadsheet = this.$refs.spreadsheet.kendoWidget();
	let sheet = spreadsheet.activeSheet();
	let selection = sheet.selection();

	console.log(
		sheet
			.range(
				selection._ref.topLeft.row,
				selection._ref.topLeft.col,
				selection._ref.bottomRight.row,
				selection._ref.bottomRight.col + 1
			)
			.values()
	);
}

I hope the above will help you implement what you need. 

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Spreadsheet wrapper
Asked by
Top achievements
Rank 1
Iron
Answers by
Petar
Telerik team
Share this question
or