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

windows 7 theme

3 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
richard
Top achievements
Rank 1
richard asked on 28 Mar 2011, 09:22 PM
ok, application wide i have set windows 7 as the theme. is it true that the windows 7 theme on the radgridview has the cell background white with the foreground white as well? Say it aint true and I have messed up.....

I have had no luck getting the foreground of the cell to any color but white. I found the below information and it still did not help:

 

 

 

<StackPanel.Resources>

 

 

 

 

  <Style x:Key="GridViewCellStyle"

 

 

 

    TargetType="telerik:GridViewCell">

 

 

 

 

    <Setter Property="Foreground"

 

 

 

      Value="DarkSlateGray" />

 

 

 

 

  </Style>

 

 

 

 

</StackPanel.Resources>

 


adn then on the dataloaded event:

 

 

private void rgvEngines_DataLoaded(object sender, EventArgs e)

 

 

{

 

 

 

  foreach (var col in rgvEngines.Columns)

 

 

  {

 

    col.CellStyle = (

 

Style)this.Resources["GridViewCellStyle"];

 

 

  }

}


The code is being executed.

Any help?

Richard

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 29 Mar 2011, 03:55 PM
Hi Richard,

 
Generally in case you need to create this style based on a theme, you need to follow the sample below which is Windows7 specific for GridViewCell:

<Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Key="GridViewCellStyle" TargetType="telerik:GridViewCell" telerik:StyleManager.BasedOn="Windows7">
                <Setter Property="Foreground" Value="Red" />
            </Style>
        </Grid.Resources>
        <telerik:RadGridView   telerik:StyleManager.Theme="Windows7" x:Name="radGridView" AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn CellStyle="{StaticResource GridViewCellStyle}" DataMemberBinding="{Binding FirstName}" Header="First Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Age}" Header="Age"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Married}" Header="Is Married"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>


We may only suggest what is going on in your project. What are you trying to achieve? The default foreground in Windows7 theme is not white colored, so it could be great if you can throw some light upon this case.
Once you share a little bit more info about the desired final result we may provide you with an appropriate solution.

Greetings,
Vanya Pavlova
the Telerik team
0
richard
Top achievements
Rank 1
answered on 29 Mar 2011, 06:09 PM
I set the theme in mainpage.xaml.cs:

public MainPage()
{

StyleManager.ApplicationTheme = new Windows7Theme();
InitializeComponent();
this.loginContainer.Child = new LoginStatus();
WebContext.Current.Authentication.LoggedOut += new System.EventHandler<AuthenticationEventArgs>(UserLoggedOut);
WebContext.Current.Authentication.LoggedIn += new System.EventHandler<AuthenticationEventArgs>(UserLoggedIn);
}

no other erference to foreground or a theme.
0
Vanya Pavlova
Telerik team
answered on 30 Mar 2011, 02:26 PM
Hello,

 
Unfortunately we may only guess what might be causing this white-colored Foreground. Can you please send us in a new support ticket a runnable project where we can see what is happening? Thus we would be able to provide you with an approrpiate solution.
 

Greetings,
Vanya Pavlova
the Telerik team
Tags
GridView
Asked by
richard
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
richard
Top achievements
Rank 1
Share this question
or