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

SelectionRegionBorder Control Implicit Styling doesn't work

3 Answers 54 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
SkyBlue
Top achievements
Rank 1
SkyBlue asked on 22 Feb 2019, 03:22 AM

<telerikGrid:RadDataGrid x:Name="DataGrid" SelectionUnit="Row">
            <telerikGrid:RadDataGrid.Resources>
                <Style TargetType="gridPrimitives:SelectionRegionBackgroundControl">
                    <Setter Property="Background" Value="Red"/>
                    <Setter Property="BorderBrush" Value="Green"/>
                    <Setter Property="BorderThickness" Value="2"/>
                </Style>
            </telerikGrid:RadDataGrid.Resources>
        </telerikGrid:RadDataGrid>

 

this.DataGrid.ItemsSource = new List<Data>
 {
     new Data { Country = "India", Capital = "New Delhi"},
     new Data { Country = "South Africa", Capital = "Cape Town"},
     new Data { Country = "Nigeria", Capital = "Abuja" },
     new Data { Country = "Singapore", Capital = "Singapore" }
 };

 

public class Data
    {
        public string Country { get; set; }

        public string Capital { get; set; }
    }

 

When I select one row, the SelectionRegionBorder Control  doesn't work.

3 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 25 Feb 2019, 09:22 AM
Hello Mo,

You would need to apply SelectionRegionBorderControl instead of SelectionRegionBackgroundControl, please try it like this:

<telerikGrid:RadDataGrid x:Name="DataGrid" SelectionUnit="Row">
    <telerikGrid:RadDataGrid.Resources>
        <Style TargetType="gridPrimitives:SelectionRegionBorderControl">
            <Setter Property="Background" Value="Red"/>
            <Setter Property="BorderBrush" Value="Green"/>
            <Setter Property="BorderThickness" Value="2"/>
        </Style>
    </telerikGrid:RadDataGrid.Resources>
</telerikGrid:RadDataGrid>

Let me know if you have any additional questions on DataGrid styling.

Regards,
Yana
Progress 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
SkyBlue
Top achievements
Rank 1
answered on 26 Feb 2019, 03:00 AM
So, you need to update your document. Because my code is from your official code sample on here: https://docs.telerik.com/devtools/universal-windows-platform/controls/raddatagrid/styling/datagrid-implicitstyling
0
Yana
Telerik team
answered on 26 Feb 2019, 06:59 AM
Hello,

I will make sure to update the topic.

Thank you for your feedback.

Regards,
Yana
Progress 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
DataGrid
Asked by
SkyBlue
Top achievements
Rank 1
Answers by
Yana
Telerik team
SkyBlue
Top achievements
Rank 1
Share this question
or