Print Page | Close Window

DataGrid and EntityGroups

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3561
Printed Date: 28-Apr-2024 at 3:27am


Topic: DataGrid and EntityGroups
Posted By: watah
Subject: DataGrid and EntityGroups
Date Posted: 31-Jul-2012 at 8:06am
I've been porting an application from DevForce 3 (Classic) to DevForce v5. I've successfully modified the code to compile with DevForce 5, but I have a hard time to bind the data (Entities) to the WPF application. 

There are a lot of DataGrids used in the WPF application and I haven't been able to bind the data to the ItemsSource element of the DataGrid. 

The entities were previously accessed via an EntityList which could easily be assigned to the ItemsSource element since it derived from an IList. 

The EntityLists were replaced by EntityGroups and I'm trying to find a way to assign the entities to the DataGrid as previously described. 

Is there a way to do so? Or should I make an EntityQuery and use the ToList() method and then assign that list to the DataGrid? (I want to avoid this solution as it will take a lot more time to refactor the project)

Thank you and good day! 




Replies:
Posted By: sbelini
Date Posted: 01-Aug-2012 at 9:04am
Hi watah,
 
Rather than using a List, I suggest you to bind the grid to an ObservableCollection.
Yes, you will need to create an EntityQuery and have the additional refactoring work, but that's the best way.
 
Regards,
   Silvio.


Posted By: watah
Date Posted: 02-Aug-2012 at 7:41am
Thank you for you help. I will follow your recommendation. 



Print Page | Close Window