We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get selected range(s) in a spreadsheet control

Thread ID:

Created:

Updated:

Platform:

Replies:

114961 Dec 16,2013 02:28 PM UTC Dec 17,2013 12:47 PM UTC WPF 1
loading
Tags: SpreadsheetControl(Classic)
Herve Martin
Asked On December 16, 2013 02:28 PM UTC

Hi,

I create a spreadsheet control ("SC") in a dialog to show the content of an Excel file. I would like upon closing the dialog to get the selected range of cells in the current sheet.

I found the property SC.ExcelProperties.CurrentExcelRangeStyle which seems to correspond to what I want, but it does not seem to work when I select multiple ranges in the spreadsheet control (using Ctrl and the mouse). Is there a way to get a multiple selection of ranges, or a list of selected ranges? If it is not possible, can I at least deactivate multi-select in the control so that my users do not believe that it is possible to select non contiguous ranges?

Best regards
Hervé





Jayapradha S [Syncfusion]
Replied On December 17, 2013 12:47 PM UTC

Hi Herve,

 

Thanks for using Syncfusion products.

 

We have analyzed your query. You can get the Selected ranges in spreadsheet control by using SelectedRanges property in GridModel as in the below code snippet,

Code Snippet:

void Button_Click(object sender, RoutedEventArgs e)

        {

            var model = this.spreadsheetControl.GridProperties.CurrentExcelGridModel;

           //you can get the multiple selected ranges from below code

            var ranges = model.SelectedRanges;

    

        }

 

Please download the sample from the below location,

 

Sample Link:

SpreadsheetDemo_WPF.zip

 

Please let us know if this helps.

 

Regards,

Jayapradha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;