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 9220021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:15:05+00:00 2026-06-18T03:15:05+00:00

Implementing a summary header row for a SL DataGrid I cannot find a way

  • 0

Implementing a summary header row for a SL DataGrid I cannot find a way to bind to the DataGrids ItemsSource property (and apply an IValueConverter).

When simply specifying Binding the Converter receives the ViewModel as the DataGrids DataContext but I’d rather not couple the ViewModel to my Converter:

<!-- somewhere in my DataGrid ControlTemplate -->
<sdk:DataGridCell Content="{Binding Converter={StaticResource SummaryRow}}" />

I tried to create a RelativeSource, but xaml complains that I cannot use AncestorType in this context:

<sdk:DataGridCell Content="{Binding RelativeSource={RelativeSource FindAncestor AncestorType={x:Type DataGrid}}, Converter={StaticResource SummaryRow}}" />

My DataGrid itself is bound to a CollectionViewSource which handles grouping and sorting.

I already implemented displaying columns sums for DataGridRowGroupHeader using the first approach and the respective Converter receives a CollectionViewGroup from which I can retrieve items without coupling to the ViewModel.

  • 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-18T03:15:06+00:00Added an answer on June 18, 2026 at 3:15 am

    I figured out the correct way to achieve this and pass the ListCollectionView bound to the DataGrids ItemsSource to the IValueConverter inside my customized ControlTemplate:

    <Style TargetType="sdk:DataGrid">
      <Setter Property="Template">
        <Setter.Value>
        <ControlTemplate TargetType="sdk:DataGrid">
    
        <!-- Rest of ControlTemplate xaml omitted -->
    
        <sdk:DataGridCell 
            Content="{Binding Path=ItemsSource, 
                              RelativeSource={RelativeSource}, 
                              Converter={StaticResource SummaryRow}}" />
        <!-- ... -->
    
        </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Implementing a custom Dependency Property on a Framework Element object causes my Visual Studio
The title is a bit blur here, I didn't find a way to say
I'm implementing n-layer PreferenceActivities 1st layer PreferenceActivity is loaded from preference-headers. First header creates
(tl;dr: see summary at the bottom.) I am implementing an application that pulls content
summary Ignore the case that an object cannot represented as an array, is it
Implementing the ScriptControlClass was extremely easy, unfortunately the side effects with the language implementation
implementing publishActivity in PHP using the REST API using this code: $activity = array(
Implementing a custom membership provider, there are certain properties such as MinRequiredPasswordLength that only
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
When implementing Serializable interface, in Java, we need to set it's serialVersionUID long. Is

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.