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

Set RadSpinEditor Selection Color

3 Answers 14 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
Damien
Top achievements
Rank 1
Damien asked on 11 Mar 2018, 05:03 AM

Is there a way to set the selection color for the RadSpinEditor like you can with a RadTextBoxControl? Or can I change the TextBox element into a TextBoxControl element and set it that way?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Damien
Top achievements
Rank 1
answered on 11 Mar 2018, 05:45 AM

I did try the following, but it didn't work - there was no number there and you couldn't click in the text area...

var textBoxSpinner = ReprintNumber.SpinElement.TextBoxItem;
textBoxSpinner.Visibility= ElementVisibility.Collapsed;
textBoxControlSpinner = new RadTextBoxControlElement();
textBoxControlSpinner.DrawBorder = false;
textBoxControlSpinner.TextAlign = HorizontalAlignment.Center;
textBoxControlSpinner.SelectionColor = Color.FromArgb(255, 168, 238, 196);
textBoxSpinner.Children.Add(textBoxControlSpinner);

 

If there is no way of doing this, can I disable the ability to select it (and in so doing prevent the standard selection color of blue)? The SpinEditor is just there for the end user to change the number, this is read when the user clicks a button and therefore there is no need for the user to be able to select the contents.

 

thanks

0
Dimitar
Telerik team
answered on 12 Mar 2018, 12:35 PM
Hi Damien,

Please note that we are using the standard textbox inside the spin editor and this is why you cannot change the selection color. What you can do is disable the text box, this way there will be no selection but you will be able to set the value using the buttons:
radSpinEditor1.SpinElement.TextBoxControl.Enabled = false;

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Damien
Top achievements
Rank 1
answered on 12 Mar 2018, 11:02 PM
Works perfectly, thanks for that.
Tags
SpinEditor
Asked by
Damien
Top achievements
Rank 1
Answers by
Damien
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or