Re: How to Bind List<> to GridView with Custom Objects
- From: "Nick Bennett" <Nick.Bennett@xxxxxxxxxx>
- Date: Sun, 20 Jan 2008 03:27:33 -0000
You can just set the DataSource to be a List<MyObject> and DataBind. You
won't get any help with setting up the columns at design time if you do it
that way - you'll have type in all the details. If you want design time
help consider using an ObjectDataSource that points to a method that returns
the list.
Nick
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:%238zetMxWIHA.1532@xxxxxxxxxxxxxxxxxxxxxxx
I see that I can create a List<string> list and bind it to a GridView
control (by setting the DataSource property to the list and calling the
DataBind method).
What's the trick to doing the same thing with my own classes instead of a
simple string? Is there an interface or something I can implement so that
the GridView control can detect the properties of my object and display
them ?
Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
.
- Follow-Ups:
- Re: How to Bind List<> to GridView with Custom Objects
- From: Jonathan Wood
- Re: How to Bind List<> to GridView with Custom Objects
- References:
- How to Bind List<> to GridView with Custom Objects
- From: Jonathan Wood
- How to Bind List<> to GridView with Custom Objects
- Prev by Date: How to Bind List<> to GridView with Custom Objects
- Next by Date: Re: How to Bind List<> to GridView with Custom Objects
- Previous by thread: How to Bind List<> to GridView with Custom Objects
- Next by thread: Re: How to Bind List<> to GridView with Custom Objects
- Index(es):
Relevant Pages
|