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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:37:03+00:00 2026-05-27T04:37:03+00:00

list.ItemsSource=db.Templates.GroupBy(t=>t.CategoryName); in xaml: <DataTemplate> <TextBlock Text={Binding Key} /> </DataTemplate> After this code. Don’t show

  • 0
list.ItemsSource=db.Templates.GroupBy(t=>t.CategoryName);

in xaml:

<DataTemplate>
   <TextBlock Text="{Binding Key}" />
</DataTemplate>

After this code. Don’t show any text in TextBlock. I’m changing Text binding like this

<DataTemplate>
   <TextBlock Text="{Binding}" />
</DataTemplate>

TextBlock Text shown like this System.Linq.Lookup^2+Grouping[System.String,Model.Template]

I’m debugging and checking Key property. this is not null.

Why Key don’t bind in TextBlock?

How to show group title in Textblock?

  • 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-05-27T04:37:04+00:00Added an answer on May 27, 2026 at 4:37 am

    Hmmm – unfortunate. The reason is because the result of the GroupBy() call is an instance of System.Linq.Lookup<,>.Grouping. Grouping is a nested class of the Lookup<,> class, however Grouping is marked as internal.

    Security restrictions in Silverlight don’t let you bind to properties defined on non-public types, even if those properties are declared in a public interface which the class implements. The fact that the object instance you are binding to is of a non-public concrete type means that you can only bind to public properties defined on any public base classes of that type.

    You could build a public shim class to act as a view model for the grouping:

    public class MyGrouping {
      public string Key {get; internal set;}
    }
    
    list.ItemsSource=db.Templates.GroupBy(t=>t.CategoryName)
                                 .Select(g => new MyGrouping { Key = g.Key });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data template for a list box items: <DataTemplate x:Key=substanceListShower> <ListBox
Binding a ListView: ItemsSource={Binding Path=DF.DocFieldEnum1rows, Mode=OneWay}. DF.DocFieldEnum1rows is List<DocFieldEnum1row> . Item template binding: <Button
I've got a TabControl which builds a list of TabItems from it's ItemsSource. Like
List<MyClass> myclassList = (List<MyClass>) rs.get(); TreeSet<MyClass> myclassSet = new TreeSet<MyClass>(myclassList); I don't understand why
I have a ListBox whose ItemsSource is bound to a list of objects. The
I am creating checked list box with the following template: <Style x:Key=CheckBoxListStyle TargetType={x:Type ListBox}>
I've got a list of strings I'm binding to an items control. The strings
I have a toolbar that binds it's ItemsSource to my VM, it's a list
Basically, I have a list of colors and a defined datatemplate for listbox item:
I have already looked into this solution: Show if ItemsControl.ItemsSource is null . I

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.