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

Background color and selecting

2 Answers 112 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John Giblin
Top achievements
Rank 1
John Giblin asked on 15 Mar 2011, 10:18 PM

For the selected items I do not see the selected color for the columns that have a background color.  here is how i am setting them

<telerik:GridViewDataColumn Header="QTR" UniqueName="Quarter" Background="Silver" DataMemberBinding="{Binding Quarter}" Width="50" />

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 16 Mar 2011, 09:40 AM
Hello John Giblin,

 
When you set Background property of a column to a specific color, it paints the background of the cells in this column. By the default the background of a GridViewCell is Transparent and you can see the background of a Row when it is being selected or in any other state. If you need to change the default colour of a column and to see the row in its different states, you need to use a color that allows transparency. Please refer to the markup below:

<telerik:RadGridView AutoGenerateColumns="False"  ItemsSource="{Binding Collection}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Background="#66C0C0C0" Header="ID" DataMemberBinding="{Binding Property1}"/>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Property2}"/>
                <telerik:GridViewDataColumn Header="CompanyName" DataMemberBinding="{Binding Property3}"/>
                <telerik:GridViewDataColumn Header="Price" DataMemberBinding="{Binding Property4}"/>
                </telerik:RadGridView.Columns>
</telerik:RadGridView>
        



Best wishes,
Vanya Pavlova
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
John Giblin
Top achievements
Rank 1
answered on 16 Mar 2011, 02:18 PM
thanks.  that worked great.  I thought I tried that.
Tags
GridView
Asked by
John Giblin
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
John Giblin
Top achievements
Rank 1
Share this question
or