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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:45:58+00:00 2026-05-25T16:45:58+00:00

I am making a WPF user control and I want similar behavior as DataGrid

  • 0

I am making a WPF user control and I want similar behavior as DataGrid control in sense of binding. My question is: How does DataGrid know how to bind to any collection of type IEnumerable? For example: You can pass a DataView as ItemsSource, and you can also pass any object collection. How DataGrid decides whether to bind to a column of DataView, or to a property of object only by looking at this:

<DataGridTextColumn Binding="{Binding **Path=SomePropertyOrColumn**}"/>

Thanks in advance.

  • 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-25T16:45:58+00:00Added an answer on May 25, 2026 at 4:45 pm

    This is a complex area; the following is a breakdown from winforms binding, but I understand that WPF binding isn’t that different;

    • given an object, the first thing binding code will do is look for IListSource – and if so use GetList() to get the actual binding (this is how a data-table becomes a data-view for binding purposes)
    • after that, the source is typically checked for ITypedList; this acts as a flexible way of obtaining pseudo-properties (GetItemProperties()) represented by the model; data-view implements ITypedList, creating pseudo-properties per instance
    • otherwise, it might be possible to identify an obvious type for the data, which can mean:
      • looking for an indexer of the form public SomeType this[int index] {get;} – note that most collections will satisfy this
      • (not done by winforms, but might be for WPF) resolving via reflection the T in either IList<T> or IEnumerable<T> if the object implements those interfaces
      • taking the first object (if any) from the sorce, and using GetType()
    • once a type is known, TypeDescriptor.GetProperties(type) can be used to obtain properties; in many cases this will be via reflection, but it is also possible to add an indirection layer (via TypeDescriptionProvider) to supply properties for a type (this can be added at runtime, which can be very convenient)
    • in the case of individual binding (not list binding), there is also TypeDescriptor.GetProperties(obj) – in addition to reflection and TypeDescriptionProvider, this also has support for ICustomTypeDescriptor which can be implemented by an individual object to supply custom properties at runtime (very similar to TypeDescriptionProvider, but with the individual object taking responsibility for the properties)

    I don’t know exactly how much of this applies to WPF binding, but I’m pretty sure the IListSource and ITypedList processing is identical. From memory, most (all?) of the winforms strategies will work on WPF – so it could be that and changes are additional hooks.

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

Sidebar

Related Questions

I am trying to create a custom user control in WPF. I want to
I am making an app in WPF in a style similar to Windows Explorer,
So I am making a piece of software in WPF, and I want to
I'm making my own ControlTemplate for a standard Button in WPF. I want to
I'm making a custom error dialog in my WPF app and I want to
I'm going to be making a user control for person information, I will then
I am currently making an MP3 player in WPF, and I want to make
Im making a user selection userControl for my WPF C# project. I did make
A WPF app has an operation of loading a user control from a separate
I'm making a mixed UserControl and Control Library in WPF. I need to provide

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.