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

Change bgcolor Custom RowLayout

6 Answers 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Iwan van Ee
Top achievements
Rank 1
Iwan van Ee asked on 08 Jul 2010, 03:18 PM
I am trying to change the selecterrow background color in the Custom RowLayout example.
How can I do that?

6 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 09 Jul 2010, 07:17 AM
Hi Iwan van Ee,

I believe that the "Office_BlackRowBackground" LinearGradientBrush is the once that you would need to change.


Kind regards,
Milan
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
0
Iwan van Ee
Top achievements
Rank 1
answered on 09 Jul 2010, 11:22 AM
But do I need to set in in code, or can I do that in the xaml styledefinition?

I'm still in a learning-curve with those styles, sorry.
0
Milan
Telerik team
answered on 09 Jul 2010, 01:11 PM
Hi Iwan van Ee,

You should do this in XAML. The XAML code of the sample contains the following resource:

<LinearGradientBrush x:Key="Office_BlackRowBackground" EndPoint="0.5,1" StartPoint="0.5,0">
               <GradientStop Color="#FF343639" Offset="1"/>
               <GradientStop Color="#FF373737" Offset="0"/>
               <GradientStop Color="#FF3A3B3D" Offset="0.15"/>
               <GradientStop Color="#FF121212" Offset="0.15"/>
           </LinearGradientBrush>

Changing this to:

<SolidColorBrush x:Key="Office_BlackRowBackground" Color="Red"/>

will change the background color to Red.

All the best,
Milan
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
0
Iwan van Ee
Top achievements
Rank 1
answered on 09 Jul 2010, 01:21 PM
Thx for the very quick answers again. But I think I didn't make myself clear. I dont just want to change the background color in all stages, but just when a grid item(s) is/are selected.
0
Iwan van Ee
Top achievements
Rank 1
answered on 13 Jul 2010, 03:01 PM
Any idea's already ? Or can I do it somehow programatically?

Thx
0
Kalin Milanov
Telerik team
answered on 15 Jul 2010, 12:40 PM
Hello Iwan van Ee,

To achieve that you will need to add some visual styles to the template and handle the selected state there.
Here is a sample XAML code which will change the background once you select the row.

<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="CommonStates">
        <VisualState x:Name="Normal"/>
        <VisualState x:Name="Selected">
            <Storyboard>
                <ColorAnimation Duration="0" To="#FF06560E" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="selectedRow" />
                <ColorAnimation Duration="0" To="#FF2F2F2F" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="selectedRow" />               
            </Storyboard>
        </VisualState>
    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>


Best wishes,
Kalin Milanov
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
GridView
Asked by
Iwan van Ee
Top achievements
Rank 1
Answers by
Milan
Telerik team
Iwan van Ee
Top achievements
Rank 1
Kalin Milanov
Telerik team
Share this question
or