Adding non data related property to entity

Posts   
 
    
mds avatar
mds
User
Posts: 33
Joined: 24-Sep-2006
# Posted on: 25-Nov-2007 16:49:24   

I'm using 2.5 version, SelfServicing and VB.Net (1.1) language....

When I use collections entity binded to datagrid is often usefull a property(binded to a boolean column) that indicates if a particular entity is selected or not... For this I add following code to entity :


Private _IsSelected As Boolean
<Bindable(True)> _
        Public Property IsSelected() As Boolean
            Get
                Return _IsSelected
            End Get
            Set(ByVal Value As Boolean)
                _IsSelected = Value
            End Set
        End Property

Is there a way to create this code in the designer for some selectable entities ? Or the only way is to manually edit the template files ?

Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Nov-2007 19:19:06   

Hi mds,

I recommend you go through this list of options in that order

A. The majority of GRID Controls have this functionality by-design. You can add Un-Bounded selection-checkbox column. Then you can ask for that selected rows as:

List<int> mySelection = myDataGrid.SelectedRows;

or something like that.

B. Do what you do. Add the code for the entities you need that functionality.

C. If a lot of entities (or all of them) requires this functionality, go to template files.

D. If a lot of projects would require this functionality go to implement your own LLBLGen plugin. You can download the SDK documentation to start.

David Elizondo | LLBLGen Support Team
mds avatar
mds
User
Posts: 33
Joined: 24-Sep-2006
# Posted on: 25-Nov-2007 20:15:13   

Thanks for your answer David

I don't have a deep knowledge of LLBLGen Designer and SDK, so I hoped in some hidden feature... stuck_out_tongue_winking_eye

I will modify template file for now ....

Bye Matteo Di Stefano