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

RadGrid Scrollbar Theme

3 Answers 270 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 28 Apr 2016, 06:02 PM
Hello,

I have created a custom theme for our application. I have themed the RadGridView and the RadScrollbars. The issue I have is the scrollbars on the grid.do not respect the theme that was created for the scrollbars. The scrollbar theme does not have dark borders around all of the objects, they are light gray. Yet the grid does not have the light borders. Is these something I am missing?

There is a screen shot attached.

Thanks,

Ben

3 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 29 Apr 2016, 11:38 AM
Hello Ben,

Thank you for writing back.

It appears that you have a setting in your theme for displaying the borders. You can access the BorderPrimitive objects of the RadScrollbar element in the VSB tool and set their ShouldPaint property to false. I am sending you attached a screenshot for hiding the border of the thumb.

If you would like you can also perform these modifications at run-time, please check my code snippet below: 
public Form1()
{
    InitializeComponent();
 
    this.RemoveScrollbarBorders(this.radGridView1.TableElement.VScrollBar);
    this.RemoveScrollbarBorders(this.radGridView1.TableElement.HScrollBar);
}
 
private void RemoveScrollbarBorders(RadScrollBarElement radScrollBarElement)
{
    radScrollBarElement.BorderElement.ShouldPaint = false;
    radScrollBarElement.ThumbElement.ThumbBorder.ShouldPaint = false;
    radScrollBarElement.FirstButton.ButtonBorder.ShouldPaint = false;
    radScrollBarElement.SecondButton.ButtonBorder.ShouldPaint = false;
}

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
 
0
Ben
Top achievements
Rank 1
answered on 29 Apr 2016, 05:04 PM

Hristo,

I needed to change the scrollbar border colors, not remove them. You code snippet did still help point me in the correct direction.

Below is the code I came up with if anyone else wants it.

Thank You,

Ben

 

public void SetCoreGridScrollbars()
        {
            // You have to do the grid scrollbar colors in manually since it does not follow the theme
            // set the color once once
            var scrollBorderColor = Color.FromArgb(168,168,168);
            //Vertical
            this.TableElement.VScrollBar.ThumbElement.ThumbBorder.ForeColor = scrollBorderColor;
            this.TableElement.VScrollBar.FirstButton.ButtonBorder.ForeColor = scrollBorderColor;
            this.TableElement.VScrollBar.FirstButton.ArrowPrimitive.ForeColor = scrollBorderColor;
            this.TableElement.VScrollBar.SecondButton.ButtonBorder.ForeColor = scrollBorderColor;
            this.TableElement.VScrollBar.SecondButton.ArrowPrimitive.ForeColor = scrollBorderColor;
            //Horizontal
            this.TableElement.HScrollBar.ThumbElement.ThumbBorder.ForeColor = scrollBorderColor;
            this.TableElement.HScrollBar.FirstButton.ButtonBorder.ForeColor = scrollBorderColor;
            this.TableElement.HScrollBar.FirstButton.ArrowPrimitive.ForeColor = scrollBorderColor;
            this.TableElement.HScrollBar.SecondButton.ButtonBorder.ForeColor = scrollBorderColor;
            this.TableElement.HScrollBar.SecondButton.ArrowPrimitive.ForeColor = scrollBorderColor;
        }

0
Dimitar
Telerik team
answered on 02 May 2016, 10:43 AM
Hi Ben,

Thank you for sharing your solution with the community. If you have any other questions, please do not hesitate to contact us.

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Themes and Visual Style Builder
Asked by
Ben
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Ben
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or