SelectionRegionBorder Control Implicit Styling doesn't work

4 posts, 1 answers
  1. SkyBlue
    SkyBlue avatar
    7 posts
    Member since:
    Aug 2016

    Posted 21 Feb Link to this post

    <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.

  2. Answer
    Yana
    Admin
    Yana avatar
    4897 posts

    Posted 25 Feb Link to this post

    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
  3. SkyBlue
    SkyBlue avatar
    7 posts
    Member since:
    Aug 2016

    Posted 25 Feb in reply to Yana Link to this post

    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
  4. Yana
    Admin
    Yana avatar
    4897 posts

    Posted 26 Feb Link to this post

    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
Back to Top