Welcome Guest Search | Active Topics | Sign In | Register

LINQ Options
MHLS
Posted: Friday, March 14, 2008 12:39:47 PM
Rank: Newbie
Groups: Member

Joined: 3/14/2008
Posts: 5
I am having trouble databinding your treeview to a linq statement using Visual Studio 2008. The ability to set a Datarelation is not there. Would it be possible for you to supply an example. I am using vb.Net

Thanks
eo_support
Posted: Friday, March 14, 2008 1:36:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

Thanks for posting in the forum. I am not sure if you can do that declaratively. You can do it through code by first using a LinqDataSource, then call its GetView("DefaultView") to get the default view, which would return you a DataView object. You can then assign this DataView object to the TreeView's DataSource property. The topic explains the rest in detail:

http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_table.html

You can not use LinqDataSource directly through the TreeView's DataSourceID property because TreeView needs hierarchical data, so it only takes IHierarchicalDataSource, LinqDataSource is not.

Thanks
MHLS
Posted: Saturday, March 15, 2008 9:32:44 AM
Rank: Newbie
Groups: Member

Joined: 3/14/2008
Posts: 5
Understood, thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.