How to get the "SupportsSorting" property in LLBLGENPro 2.0

Posts   
 
    
sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 23-Nov-2006 08:36:53   

Hi, I am using LLBLGENPro2.0 in my web application.The platform for my project is VStudio 2005,.Net2.0,SQLServer2005 etc., In LLBLGENPro 1.1 i used Collection.SupportsSorting = true; in my code. Now its not supported in LLBLGen2.0.

My code is: PeergroupyearCollection objPGYearCollec = new PeergroupyearCollection(); filter = new PredicateExpression(PredicateFactory.CompareValue(PeergroupyearFieldIndex.PeerGroupId, ComparisonOperator.Equal, strPGID)); objPGYearCollec.GetMulti(filter); objPGYearCollec.SupportsSorting = true;

So that my telerik grid sorted functionality working fine. Now in LLBL2.0 sorting is not working.

How to get the same "Sorting" functionality for entitycollection in LLBLGENPro 2.0?

Please help me to solve this issue as soon as possible.

Thanks in advance, Balaji

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39833
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 10:14:49   

It's implemented on the entity view. So set SupportsSorting on the entityview instance you receive when you call objPGYearCollec.DefaultView. That view is bound to the grid.

Btw, you can also use an llblgenprodatasourcecontrol in webapplications.

Frans Bouma | Lead developer LLBLGen Pro
sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 23-Nov-2006 10:33:24   

Hi, Thank you for your support given. Can you provide any sample source code for that?

Thanks in advance, Balaji

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39833
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 11:30:45   

objPGYearCollec.DefaultView.SupportsSorting = true;

Frans Bouma | Lead developer LLBLGen Pro
sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 23-Nov-2006 12:31:57   

Hi, Now i am getting the error while compilation like this:

Error:

'SD.LLBLGen.Pro.ORMSupportClasses.EntityView<CDMS.DAL.EntityClasses.PeergroupyearEntity>' does not contain a definition for 'SupportsSorting' at D:\CDMS435\DesktopModules\CDMSModules\Components\CDMS.BLMGR\PeerGroupDetailsBLMGR.cs

What should i do?

Balaji

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39833
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 13:04:53   

My bad, you've to cast to IBindingList first: ((IBindingList)objPGYearCollec.DefaultView).SupportsSorting = true;

Frans Bouma | Lead developer LLBLGen Pro
sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 23-Nov-2006 13:24:14   

Hi, I am very sorry now i am getting the error while compilation like this:

Error:

The type or namespace name 'IBindingList' could not be found (are you missing a using directive or an assembly reference?) D:\CDMS435\DesktopModules\CDMSModules\Components\CDMS.BLMGR\PeerGroupDetailsBLMGR.cS

What should i do?

Balaji

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 23-Nov-2006 14:00:58   

Hi,

IBindingList is in the namesapce : System.ComponentModel so you need to import or use the full name (System.ComponentModel.IBindingList).

sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 23-Nov-2006 14:16:25   

Hi, Again i got the error.

Property or indexer 'System.ComponentModel.IBindingList.SupportsSorting' cannot be assigned to -- it is read only D:\CDMS435\DesktopModules\CDMSModules\Components\CDMS.BLMGR\PeerGroupDetailsBLMGR.cs

Please answer it asap.

Thanks in advance, Balaji

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39833
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 15:10:22   

sbalaji123 wrote:

Hi, Again i got the error.

Property or indexer 'System.ComponentModel.IBindingList.SupportsSorting' cannot be assigned to -- it is read only D:\CDMS435\DesktopModules\CDMSModules\Components\CDMS.BLMGR\PeerGroupDetailsBLMGR.cs

Please answer it asap.

Thanks in advance, Balaji

Ok, I took a step back and really looked into this, and we have given you bad advice, sorry for that.

The thing is that IBIndingList.SupportsSorting is a readonly property, it only defines a get. It always returns true, so an entity view is always sortable. This property is used by controls which have to determine if the object (in this case the entityview) supports sorting code or not, llblgen pro code does so true is returned.

If you want to disable sorting, you have to do that in the control.

Frans Bouma | Lead developer LLBLGen Pro