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

  • Home
  • SEARCH
  • 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 8563125
In Process

The Archive Base Latest Questions

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

I have a style defined in a file called MyStyles.xaml: <Style TargetType={x:Type igDP:XamDataGrid}> <Setter

  • 0

I have a style defined in a file called MyStyles.xaml:

<Style TargetType="{x:Type igDP:XamDataGrid}">
    <Setter Property="FontSize" Value="10" />
    <Setter Property="FontFamily" Value="Arial" />
    <EventSetter Event="CellUpdating" Handler="grid_CellUpdating"/>
</Style>

In one of my views, I have a XamDataGrid defined:

<igDP:XamDataGrid>
    <igDP:XamDataGrid.Resources>
      <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="/MyProject.TheViews;component/Views/MyStyles.xaml"/>
        </ResourceDictionary.MergedDictionaries>
        <Style TargetType="{x:Type igDP:XamDataGrid}" BasedOn="{StaticResource {x:Type igDP:XamDataGrid}}">
          <Setter Property="FontSize" Value="70"/>
        </Style>
      </ResourceDictionary>
     </igDP:XamDataGrid.Resources>

Basically, I want to keep everything that is defined in the style for XamDatagrid in MyStyles.xaml except for the font size, which I want to be set to 70.

I can’t seem to get it to work. With the above, the font is set to 70 but I lose the other settings that are defined in MyStyles (such as the event handling and font family).

What am I doing wrong here?

  • 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-11T16:53:20+00:00Added an answer on June 11, 2026 at 4:53 pm

    (Extracting an answer from comments above.)

    For overriding the style, I would suggest the following:

    Define 2 styles in MyStyles.xaml: a named one which contains the style, and the unnamed one (this will be the default style) simply based on the named one

    <Style x:Key="XamDataGridDefaultStyle" TargetType="{x:Type igDP:XamDataGrid}">
        <Setter Property="FontSize" Value="10" />
        <Setter Property="FontFamily" Value="Arial" />
        <EventSetter Event="CellUpdating" Handler="grid_CellUpdating"/>
    </Style>
    
    <Style TargetType="{x:Type igDP:XamDataGrid}"
           BasedOn="{StaticResource XamDataGridDefaultStyle}"/>
    

    This will define the needed default style for all the views.

    For the resources of the view where the customization is needed, define the following override:

    <Style TargetType="{x:Type igDP:XamDataGrid}"
           BasedOn="{StaticResource XamDataGridDefaultStyle}">
        <Setter Property="FontSize" Value="70"/>
    </Style>
    

    You’ll perhaps need to reference MyStyles.xaml as merged dictionary in the resources of the customized view for StaticResource to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this style: <Style x:Key=SelectableListBoxItemStyle TargetType={x:Type ListBoxItem}> <Setter Property=Template> <Setter.Value> <ControlTemplate TargetType={x:Type ListBoxItem}>
I have the following custom defined Button defined in my App.xaml file. <Style x:Key=DispatchListCallButton
I have a ListBox in a file called Downloads.XAML. The items bound to that
I have defined style for my WPF listbox but am adding a rectangle manually
I have the following style defined which is being applied (as text changes to
I have defined a default binding in my style. For example I have configured
I have the following style defined in the ResourceDictionary of a Silverlight 4.0 application
I have a div in an html file defined as follows: <div id=rangeTabAll></div> In
I have a function called get_header() which includes the header file in a template
I have something like the following (shown below) defined in my styles.xml file. But

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.