Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:19:59+00:00 2026-06-18T16:19:59+00:00

In a WPF user control declaration I have the following style define: <UserControl.Resources> <Style

  • 0

In a WPF user control declaration I have the following style define:

<UserControl.Resources>
  <Style x:Key="Datagrid" TargetType="{x:Type DataGrid}">
     <Setter Property="Background" Value="Transparent"/>

     <Setter Property="BorderBrush" Value="Transparent"/>
     <Setter Property="HeadersVisibility " Value="Column"/>
     <Setter Property="VerticalGridLinesBrush " Value="{StaticResource DatagridVerticalLinesBrush}"/>
     <Setter Property="HorizontalGridLinesBrush " Value="Transparent"/>
     <Setter Property="RowHeaderWidth " Value="0"/>
     <Setter Property="CanUserAddRows " Value="False"/>
     <Setter Property="CanUserDeleteRows " Value="False"/>
  </Style>
</UserControl.Resources>

The problem is that the Visual Studio 2012 designer thinks the properties don’t exist on the type DataGrid. It says that: the member “XXXXXXXXXXXX” is not recognized or is not accessible.

Despite the errors, the style is applied correctly at run time and the properties exist on the DataGrid (they are DependencyProperies) and are public.

Any idea what could be causing it to think they don’t exist or why are they inaccessible to the designer?

By the way, the Background property is ok. It’s only the other 7 that have errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:20:00+00:00Added an answer on June 18, 2026 at 4:20 pm

    I have loaded this up in VS2012, created a UserControl, added the above style. I observed that the Background and BorderBrush properties are seen as valid, but the others are not.

    Then…I noticed the spaces in the quoted names. Once removed all is well…

    <UserControl.Resources>
        <Style x:Key="Datagrid" TargetType="{x:Type DataGrid}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HeadersVisibility" Value="Column"/>
    
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="VerticalGridLinesBrush" Value="{StaticResource DatagridVerticalLinesBrush}"/>
            <Setter Property="HorizontalGridLinesBrush" Value="Transparent"/>
            <Setter Property="RowHeaderWidth" Value="0"/>
            <Setter Property="CanUserAddRows" Value="False"/>
            <Setter Property="CanUserDeleteRows" Value="False"/>
        </Style>
    </UserControl.Resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a newbie WPF question. Imagine my user control has a namespace declaration
I have this custom wpf user control: ShowCustomer.xaml: <UserControl x:Class=TestControlUpdate2343.Controls.ShowCustomer xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml> <Grid> <TextBlock
I have the following xaml which resides in a wpf user control - <Grid>
I have a WPF user control that contains a DataGrid. This DG contains several
I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is
I have a WPF user control. In that userControl I'll have multmple WPF childControls(inherits
I have a WPF user control with a number of textboxes, this is hosted
I have a wpf user control which exposes an IEnumerable ItemsSource DependencyProperty. I bind
I have a WPF User control that binds to a DataTable and generates CheckBox
I have a WPF user control. It contains several Expanders separated with GridSplitters. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.