Here’s how I pull a field from my object:
However, how do I pull a field if it’s in a subclass (Customer.ContactInfo.Name)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you know that the DataItem is a certain type (let’s say you know it’s a CustomerInfo type), you can do this:
As a bonus, it’s somewhat quicker than using DataBinder.Eval, because you avoid all the overhead of reflection.