RSS 2.0 | Atom 1.0 | CDF

Search

Categories

Archive

Blogroll

Sign In

# Wednesday, December 21, 2005
Wednesday, December 21, 2005 3:51:28 PM (GMT Standard Time, UTC+00:00) ( Asp.Net )

A field or property with the name 'xyz' was not found on the selected data source

I get this error when i bind a GridView to an array of custom objects with public variables. 
The recommended pattern for designing classes is to have private variables with public properties with get/set etc, but for my current application i'm not bothering with that. Apparently because of the Reflection methods used in GridView databinding, you have to have properties to bind fields in the GridView to your object fields. 

bit of a pain.

Comments [3] | | # 
Tuesday, February 21, 2006 5:15:37 PM (GMT Standard Time, UTC+00:00)
Thank you! You saved me... I was about to give up and use a contrived dataset.
Wednesday, August 29, 2007 10:02:51 AM (GMT Daylight Time, UTC+01:00)
Tim, I've been looking for this explanation on the web for hours! Thanks for sharing it.
Jakub Roth
Tuesday, September 13, 2011 1:31:38 PM (GMT Daylight Time, UTC+01:00)
Perfect, thanks!
Jack
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview