Error When Styling The GridView

2 posts, 0 answers
  1. David
    David avatar
    20 posts
    Member since:
    Nov 2015

    Posted 23 Sep Link to this post

    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?

  2. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 27 Sep Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top