Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Collapse]Data Binding Common Concepts
    How to: Bind GridControl to Database and Implement Master-Detail Mode at Design Time
    How to: Bind a Control to a Database at Runtime
    How to: Bind a Control to Data Created at Runtime
    How to: Bind a Control to Data in an XML File
    Traditional Data Binding Methods
    Data Source Configuration Wizard
    Data Binding Mechanism in ADO.NET
    Binding Controls to XML Data
    Binding Controls to Data Created at Runtime
    Add Unbound Data to a Data-Aware Control (XtraGrid, XtraPivotGrid)
    Binding to Excel Data Sources
    Binding to LINQ to SQL Classes
    Unbound Sources
    Binding to Entity Framework Core
    Binding to OData
    Binding to SQL Data
    Data Annotation Attributes
    How to: Add Virtual Rows Using the UnboundSource Component
    Obtaining Fields Available in Data Source
  [Expand]Data Source Wizard
  [Expand]Expressions
  [Expand]Behaviors
  [Expand]Application Appearance
  [Expand]Filtering UI Context
  [Expand]High DPI Support
  [Expand]Scaffolding Wizard
  [Expand]Formatting Values
   HTML Text Formatting
  [Expand]Menus
  [Expand]Tooltip Management
  [Expand]Saving and Restoring Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Obtaining Fields Available in Data Source

Data-aware controls (e.g., Grid Control and XtraTreeList) can be bound to various data sources (e.g., BindingList<T>, List<T>, IList and ITypedList). When bound to a data source, the control needs to determine fields (properties) available in the data source that can potentially provide data for columns. For instance, information on available fields allows for automatic column creation.

Information on the fields available in the data source is retrieved as follows.
  1. If the data source implements the ITypedList interface, this information is obtained using the methods of this interface.
  2. If the data source provides an indexer [], available properties in the data source match public properties provided by the indexer's return type.
  3. If the data source derives from the List<T> type, available properties in the data source are those exposed by the generic type T.
  4. If the data source implements the IList interface, the first item is retrieved from the IList, and this item's public properties will determine the properties available in the data source for a data-aware control.
    Note

    Information on the first item's properties is retrieved only when assigning the data source to the data-aware control. Ensure that the data source contains at least one item of a target type prior to binding the data source to the control.

How would you rate this topic?​​​​​​​