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

Remove Row selection and mouse over

2 Answers 53 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Cristina
Top achievements
Rank 1
Cristina asked on 26 Oct 2010, 12:33 PM
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 Answers, 1 is accepted

Sort by
0
Cristina
Top achievements
Rank 1
answered on 26 Oct 2010, 03:34 PM
thanks, I could solve
0
Vanya Pavlova
Telerik team
answered on 29 Oct 2010, 09:18 AM
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
Tags
TreeListView
Asked by
Cristina
Top achievements
Rank 1
Answers by
Cristina
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or