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

Error When Styling The GridView

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 23 Sep 2016, 12:25 PM

I haven't had this issue before. It began as soon as I updated to the latest version of Visual Studio 2015 and updated to the latest release of the WPF Controls.

Here is a style I have created for the GridView.

<Style x:Key="GridViewStyle" TargetType="{x:Type telerik:RadGridView}">
    <Setter Property="AutoGenerateColumns" Value="False"/>
    <Setter Property="EnableLostFocusSelectedState" Value="False"/>
    <Setter Property="SelectionUnit" Value="FullRow"/>
    <Setter Property="SelectionMode" Value="Single"/>
    <Setter Property="GroupRenderMode" Value="Flat"/>
    <Setter Property="IsReadOnly" Value="True"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
    <Setter Property="IsFilteringAllowed" Value="False"/>
    <Setter Property="CanUserDeleteRows" Value="False"/>
    <Setter Property="CanUserInsertRows" Value="False"/>
    <Setter Property="GridLinesVisibility" Value="Both"/>
    <Setter Property="RowIndicatorVisibility" Value="Collapsed"/>
    <Setter Property="RowHeight" Value="20"/>
</Style>

Every single Setter throws the following error (with the exception of 'GroupRenderMode' and 'ScrollViewer.VerticalScrollBarVisibility'):

The property "[PropertyName]" is not a DependencyProperty. To be used in markup, non-attached properties must be exposed on the target type with an accessible instance property "[PropertyName]". For attached properties, the declaring type must provide static "Get[PropertyName]"  and "Set[PropertyName]" methods.

Anyone having similar issues?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 27 Sep 2016, 09:14 AM
Hi David,

I tried a similar solution on my side and unfortunately, I was not able to reproduce the problem. Attached you can find the project I used for the test. Please give it a try and let me know in case I am missing something.

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