Remove Row selection and mouse over

3 posts, 0 answers
  1. Cristina
    Cristina avatar
    8 posts
    Member since:
    Oct 2010

    Posted 26 Oct 2010 Link to this post

    Hi wanted to know how I can get the style of the selection and the mouse over a row that I have configured TreeListView with two colors of different rows, one for parent nodes and another for children.This is the code:
     
    public class RowStyleSelector : StyleSelector
        {
            public override Style SelectStyle(object item, DependencyObject container)
            {
                if (item is Group)
                    return Application.Current.Resources["GroupRowStyle"] as Style;              
                else
                    return Application.Current.Resources["GroupRowStyleNew"] as Style;          
            }
        }

    <Application.Resources>               
            <Style x:Key="GroupRowStyle" TargetType="telerik:GridViewRow">            
                <Setter Property="Background" Value="#FF000000"/>
            </Style>
            <Style x:Key="GroupRowStyleNew" TargetType="telerik:GridViewRow">            
                <Setter Property="Background" Value="#FF262626"/>            
            </Style>
        </Application.Resources>

  2. Cristina
    Cristina avatar
    8 posts
    Member since:
    Oct 2010

    Posted 26 Oct 2010 Link to this post

    thanks, I could solve
  3. DevCraft banner
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 29 Oct 2010 Link to this post

    Hi Cristina,

    In order to achieve this result, you should edit the template of the GridViewRow and change the brushes respectively named ItemBackground_Over and ItemBackground_Selected  that are used to paint GridViewRow's background in these states. Also I have prepared an example for you that demonstrates this approach.

    Please check the attached project and let me know if you need any additional information.

    Best wishes,
    Vanya Pavlova
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top