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

The Archive Base Latest Questions

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

For a data bound control it is common scenario where we provide data text

  • 0

For a data bound control it is common scenario where we provide data text field and data value field ( in simple controls like Dropdownlist) but more fields in controls like Gridview. Generally the datasource is of type IEnumerable.

  • How does the control internally process these values or rather how do they get the value from the data source without knowing what kind of datasource they are dealing with.

  • Can someone explain with code how the controls evaluate these fields from the data source.

  • 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-30T16:37:59+00:00Added an answer on May 30, 2026 at 4:37 pm

    I never knew i could find this information so easily and LLyod was in fact wrong on using reflection to find data from a datasource. None of the data controls use it when i inspected through Reflector ;(

    link that solved the problem

    http://msdn.microsoft.com/en-us/library/ms366540.aspx

    how you do it is below

    protected override void PerformDataBinding(IEnumerable retrievedData)
            {
                base.PerformDataBinding(retrievedData);
    
                // Verify data exists.
                if (retrievedData != null)
                {
    
                    string dataStr = String.Empty;
    
                    foreach (object dataItem in retrievedData)
                    {
                        if (DataTextField.Length > 0)
                        {
                            dataStr = DataBinder.GetPropertyValue(dataItem,
                                DataTextField, null);
                        }
                        else
                        {
                            PropertyDescriptorCollection props =
                                    TypeDescriptor.GetProperties(dataItem);
                            if (props.Count >= 1)
                            {
                                if (null != props[0].GetValue(dataItem))
                                {
                                    dataStr = props[0].GetValue(dataItem).ToString();
                                }
                            }
                        }
                    }
    
                }
            }
    

    If the above code seem Greek and Latin , you will have to have a course on asp.net controls development to understand what is being done.

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

Sidebar

Related Questions

I have a set of controls bound to data, on which I would like
I have a problem with a data-bound DataGrid control, in that despite each column
So I'm amending someone else's code, and they've used a data-bound Accordion control. I
I have a list control in Flex that has been data bound to an
I have a .NET repeater control that is data-bound to a List. As part
i have little dilemma, i often use data-bound controls such as Gridview in conjunction
I have the DGV bound to data and all the other controls properly. What
What is the best way to create a data bound ASP.NET user control? I
In a Asp Net data bound control one can use the nice Eval() syntax:
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages.

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.