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

Gridview selected row border

1 Answer 646 Views
GridView
This is a migrated thread and some comments may be shown as answers.
W
Top achievements
Rank 1
W asked on 11 Aug 2016, 01:26 PM

Hi,

If i select a row in the gridview, the selected color is orange and has a red border around it.

How can I remove this border?

The same for the row that is under the mousecursor. The color is than yellow, but it also has red border.

I tried this one but it does not work:

<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderThickness" Value="0" />
</Style>

Christy
Top achievements
Rank 1
Iron
commented on 03 Aug 2021, 01:35 PM

I have the same problem. I ask for an exampl. 

I've tried this but it doesn't work:

        <Style TargetType="telerik:RadGridView">
            <Setter Property="Foreground" Value="#585857"/>
            <Setter Property="Background" Value="#FF131313" />
            <Setter Property="FontSize" Value="30"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="BorderBrush" Value="#FF131313"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="VerticalGridLinesBrush" Value="Black"/>
            <Setter Property="HorizontalGridLinesBrush" Value="Black"/>
            <Style.Triggers>
                <Trigger Property="IsFocused" Value="True">
                    <Setter Property="Background" Value="#FF131313"/>
                    <Setter Property="BorderBrush" Value="#FF131313"/>
                    <Setter Property="VerticalGridLinesBrush" Value="Black"/>
                    <Setter Property="BorderThickness" Value="100"/>
                </Trigger>
                <Trigger Property="IsFocused" Value="False">
                    <Setter Property="BorderBrush" Value="#FF131313" />
                    <Setter Property="Background" Value="Red"/>
                    <Setter Property="VerticalGridLinesBrush" Value="Black"/>
                    <Setter Property="BorderThickness" Value="100"/>
                </Trigger>
            </Style.Triggers>
        </Style

 

Dilyan Traykov
Telerik team
commented on 04 Aug 2021, 12:09 PM

Hello Christy,
Just to clarify - can you please confirm that you want to remove the border from the selected and hovered rows? If that is the case, you need to define a style targeting the GridViewRow element rather than the RadGridView control and modify the elements I've specified in my answer below.
If you would specify which theme(s) you're using, I'd be happy to demonstrate how you can achieve this.
Christy
Top achievements
Rank 1
Iron
commented on 10 Aug 2021, 11:40 AM

Hello

The problem was solved when CanUserSelect = "False".

Dilyan Traykov
Telerik team
commented on 11 Aug 2021, 12:34 PM

Hello Christy,
I'm glad to hear that you've managed to find a suitable solution.

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 15 Aug 2016, 12:36 PM
Hello,

In order to achieve the desired look, you should create an appropriate style targeting the GridViewRow element and predefine its default ControlTemplate. The elements you need to modify are the Background_Selected and Background_Over.

Please give this a try and let me know if you need any further assistance on the matter.

If modifying the control template does not work for you, please specify whether you're using Implicit Styles or not, which theme you're using and whether you've applied styles targeting the GridViewRow element.

Additionally, you may open a new support ticket and provide a sample project for us to investigate.

Thank you in advance for your cooperation.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
W
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or