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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:17:49+00:00 2026-05-18T08:17:49+00:00

Using Linq pad I created a view on data in the database which I

  • 0

Using Linq pad I created a view on data in the database which I now hope to replicate in a WPF Application.

I took advantage of the Linq Dump() method. By implementing ICustomMemberProvider I could provide the column headers, types and values which I wanted to be output. The three methods I needed to implement were;

   public IEnumerable<string> GetNames() 
   public IEnumerable<Type> GetTypes()
   public IEnumerable<object> GetValues()

This was a simple, quick and clean way of describing what the Dump()‘ for single or multiple rows should be.

For the life of me I cannot find anything as straight forward in WPF. I have a dynamic (per run not per row) number of Columns and so I can’t hard code Column titles and binding paths, there may be 5 columns and there may be 20.

I was pointed towards ICustomTypeDescriptor but I need a concrete example of how that would work as there are so many methods in that interface.

I’m really hoping there’s something simpler that I’ve missed which will allow me to implement dynamically what the rows and columns should contain given an IEnumerable of my custom class.

Any links to a tutorial or overview of how this is meant to work would be greatly appreciated. I have been surprised by the lack of documentation I’ve found so I must be using the wrong terms.

For clarity the source of a single row is an instance of a class like this;

public class CustomDatum 
{
   public string ID {get; private set;}
   public string Location {get; private set;}

   public IEnumerable<Attributes> attributes {get; private set;}

   public class Attribute 
   {
       public string Name {get; private set;}
       public string Value {get; private set;}

       public override ToString()
       {
           ....
       }
   }
}

I want to display the ID, Location and all attributes in a single Row, I have an IEnumerable<CustomDatum> to bind to. The actual class is a lot more complex than this example naturally.

Thanks!

  • 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-18T08:17:50+00:00Added an answer on May 18, 2026 at 8:17 am

    I’m pretty sure you can use a DataGridView and set its AutoGenerateColumns to true.

    example of ICustomTypeDescriptor

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

Sidebar

Related Questions

Using LINQ to Entities sounds like a great way to query against a database
I'm using LINQ to SQL classes in a project where the database design is
I've been using Linq to SQL for some time now and I find it
I'm using LINQPad to create LINQ queries in an application I'm bulding. I noticed
I'm using LINQ to query my database, and I don't want all the records
Using LINQ to SQL, I have an Order class with a collection of OrderDetails.
Using LINQ to SQL db.Products.Where(c => c.ID == 1).Skip(1).Take(1).ToList(); executes SELECT [t1].[ID], [t1].[CategoryID], [t1].[Name],
When using Linq to SQL and stored procedures, the class generated to describe the
I am using LINQ to query a generic dictionary and then use the result
We've just started using LINQ to SQL at work for our DAL & we

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.