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

Styling the Selection Rectangle

3 Answers 89 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 18 Sep 2015, 01:41 PM
Hello, is it possible to style the selection rectangle for the RadSpreadsheet control? I can't seem to find where it is being applied.

3 Answers, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 21 Sep 2015, 12:15 PM
Hello Bryan,

The selection rectangle is created and modified through the code of the SelectionUILayer and by the time being there is no public API that can be used to modify it except implementing new custom SelectionUILayer.
Could you share with us what would you like to do with it? This way I will be able to try to find a workaround and add the feature request in our backlog.

Regards,
Nikolay Demirev
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
Bryan
Top achievements
Rank 1
answered on 21 Sep 2015, 01:25 PM

I did manage to trace it back to the SelectionUILayer.

 I am looking to use the RadSpreadsheet as a customizable display, but this issue and the one mentioned here

http://www.telerik.com/forums/updating-a-named-range-programmatically#vFMKWJz6QkKWSlRvXpDY8g

are the major roadblocks.

 

Essentially, the user configures the sheet with some parameters that update in the background and the display reflects the current values. In display mode I want to hide the selection rectangle.

0
Nikolay Demirev
Telerik team
answered on 23 Sep 2015, 03:11 PM
Hello,

To be able to hide the selection rectangle you can remove the SelectionUILayer. This can be achieved creating a custom UI layers builder. You could use the following code:
public class CustomWorksheetUILayersBuilder : WorksheetUILayersBuilder
{
    public override void BuildUILayers(Telerik.Windows.Controls.Spreadsheet.Layers.UILayerStack<WorksheetUILayerBase> uiLayers)
    {
        base.BuildUILayers(uiLayers);
 
        uiLayers.Remove(WorksheetPredefinedUILayers.Selection);
    }
}

In the constructor of your control you can use the following line:
this.radSpreadsheet.WorksheetUILayersBuilder = new CustomWorksheetUILayersBuilder();

If you want to remove it on some event this can be achieved little hacky. First you have to set the custom builder and then to change the active worksheet to another one and then return the previous active worksheet, this way you will force the layers to be build.

Regards,
Nikolay Demirev
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
Spreadsheet
Asked by
Bryan
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or