Data binding to gridview

Posts   
 
    
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 12-Jul-2006 12:34:28   

Hello all,

Just started using the evaluation yesterday, looks great on first impressions, using it to rebuild a legacy database/ASp website using.net 2 (hopefully). Anyway, on with the question.

When I data bind to the data source object (self-servicing), should I get a correct list of entity fields showing in the columns of the grid at design time and when adding/selecting new fields/columns there are no bound fields showing up? The page displays correctly on load, but is not very easy to work with at design time (as say the SQL data source and the grid view at design time) .

Hopefully this is a set up issue that you can help me sort out.

Also, say I wanted to filter my result set on all customers last name containing a particular string (say WAR, you would use a like clause in SQL to achieve this), can I do this at design time? Or do I have to use filter predicates in my code? Regards.

I notice somebody mentioned an example application available, could you point me to it.

Thanks again,

Matthew

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 12-Jul-2006 16:07:32   

Just started using the evaluation yesterday, looks great on first impressions, using it to rebuild a legacy database/ASp website using.net 2 (hopefully). Anyway, on with the question.

When I data bind to the data source object (self-servicing), should I get a correct list of entity fields showing in the columns of the grid at design time and when adding/selecting new fields/columns there are no bound fields showing up? The page displays correctly on load, but is not very easy to work with at design time (as say the SQL data source and the grid view at design time) .

Yes, everything shows up and works quite nicely. It works the same as the regular datasource/grids.

Here is a tutorial. http://weblogs.asp.net/fbouma/archive/2006/06/09/LLBLGen-Pro-v2.0-with-ASP.NET-2.0.aspx

Also, say I wanted to filter my result set on all customers last name containing a particular string (say WAR, you would use a like clause in SQL to achieve this), can I do this at design time? Or do I have to use filter predicates in my code? Regards

You do this in code. If you were allowed to do this in the designer - then it would not get compile time checked - violating one of the great things about LLBLGen.

However, having said that - you can still bind it to select parameters like other controls on the form, etc - just like a normal datasource - just click select parameters in the properties window.

For code, just use FilterToUse, SorterToUse, etc.

Wayne

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 12-Jul-2006 23:22:50   

Thank you for your reply Wayne, that article certainly pointed out what I should be able to do :-)

Have you any idea why the entity fields are not showing correctly in the Grid view at design time as mentioned above even though the code works at runtime, no wonder I was confused.

Thanks for your help,

Regards,

Matthew

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 13-Jul-2006 01:02:02   

Do you get any errors? Are you using the latest build and latest version of the controls (not beta)?

It has to be something like that, because it does work fine. Are you using EntityCollections or something else?

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 13-Jul-2006 11:31:57   

Hello Wayne,

Figured it out, although I had added the reference

SD.LLBLGen.Pro.ORMSupportClasses

To my project, I was not using it specifically on the page.

Regards,

Matthew