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

Custom style for propertygridfield is not working

1 Answer 95 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Sanaka
Top achievements
Rank 1
Sanaka asked on 10 Jun 2016, 08:34 AM

Can you please look into this issue

 

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <Style x:Key="fieldStyle" TargetType="telerik:PropertyGridField" BasedOn="{StaticResource PropertyGridFieldStyle}">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </Window.Resources>
    <Grid>
        <telerik:RadPropertyGrid x:Name="PropertyGrid1" FieldStyle="{StaticResource fieldStyle}"/>
    </Grid>
</Window>

 

Iam getting XAML Parse Exception when i tried to define style PropertyGridFieldStyle 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 13 Jun 2016, 08:40 AM
Hello ,

Could you please specify the inner exception of the XAML Parse Exception you're getting?

I cannot be absolutely sure from the information you've provided so far, but one possible reason for this exception is that you're referencing the standard binaries instead of the NoXaml ones. Bear in mind that this is needed when using Implicit Styles.

I'm attaching a sample project, where I've styled RadPropertyGrid's fields with the code you've provided in your previous reply. Please have a look at it and let me know if I'm missing something important.

If referencing the NoXaml binaries does not solve your issue, feel free to provide more information about the exception and your exact setup and I will gladly assist you further.

Regards,
Dilyan Traykov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Sanaka
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or