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

[Solved] DataCellsPresenter's Foreground Property not working?

2 Answers 235 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Diego
Top achievements
Rank 1
Diego asked on 14 Feb 2011, 02:32 PM
Hello, i have a RadGridView called with that code:

<telerik:RadGridView x:Name="grid"  RowIndicatorVisibility="Collapsed" RowDetailsVisibilityMode="Collapsed" IsScrolling="False" ShowGroupPanel="False" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" Width="600" Height="600" HorizontalAlignment="Left" Margin="10,0,-7,0">
             
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewToggleRowDetailsColumn />
                <telerikGrid:GridViewDataColumn x:Name="ResourceUsernameColumn" Width="Auto" SortingState="Ascending" TextWrapping="Wrap" Header="User"/>
                <telerikGrid:GridViewDataColumn x:Name="ResourceEnabledColumn" Width="Auto"  SortingState="Ascending" TextWrapping="Wrap" Header="Status"/>
            </telerikGrid:RadGridView.Columns>
             
            <telerikGrid:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                    <Grid Height="300">                    
                        <TextBlock Foreground="Black">details text</TextBlock>
                        <MN_Command_Theme:IconAbort/>
                    </Grid>
                </DataTemplate>
            </telerikGrid:RadGridView.RowDetailsTemplate>
             
        </telerik:RadGridView>

and i need to change foreground color of each single row.
As i seen in a thread in that forum, i'm expecting that giving "Foreground" property to DataCellsPresenter in GridViewRow Template will be good for me.
Don't know why, it's not working at the moment.
<grid:DataCellsPresenter Grid.Column="3" Foreground="Red" telerik:StyleManager.Theme="{StaticResource Theme}" x:Name="PART_DataCellsPresenter"  />

Can you give me some help? I also need to change foreground color in mouseover, but that will be possible only with that property working (i think).
Thanks.

Diego

2 Answers, 1 is accepted

Sort by
0
Diego
Top achievements
Rank 1
answered on 15 Feb 2011, 10:09 AM
Can anyone help me please?
0
Vanya Pavlova
Telerik team
answered on 15 Feb 2011, 03:24 PM
Hello Diego,

 
The DataCellsPresenter is used to create and to display cells. Considering the internal logic of the GridViewRow, the correct approach is to directly set the Foreground property of GridViewRow through a style:

<Style x:Key="GridViewRowStyle1" TargetType="telerik:GridViewRow">         
        <Setter Property="Foreground" Value="Yellow" />
</Style>
 
As far as changing the Foreground on MouseOver is concerned, you can animate the Foreground property of the DataCellsPresenter within the GridViewRow template. You may see this approach in the attached project. 
Let me know if you need any further assistance.

Best wishes,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Diego
Top achievements
Rank 1
Answers by
Diego
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or