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.
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
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.