Typed View field caption on 3.1 Final

Posts   
 
    
fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 16-Jun-2011 16:26:25   

I have migrated from LLBL 2.6 final to 3.1 Final.

In 2.6, Typed Views had a Field Property called "Caption" that bound to my dataviews' "Caption" property, so that I could have a more user-friendly name.

Where did this go in 3.1?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 16-Jun-2011 21:08:59   

Strange - TypedView fields are really just ADO.Net DataColumns, and they still have a .Caption property - and it's unlikely that we'd have removed that property.

Is it it not showing up in Intellisense ? Or is the code refusing to compile ?

Matt

fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 16-Jun-2011 21:36:16   

In the 2.6 designer there is a field to set the selected typed view field's caption.

I can't find anywhere in 3.1 where this might be.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Jun-2011 06:45:04   

There is no Caption on TypedView's fields in v3.x, you just have it in TypedLists. I have to check whether this is by design.

You also could use CustomProperties for that purpose.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 17-Jun-2011 11:22:29   

It's by design. The caption fields were hardly used, and in typedlists they make sense as you can have duplicate fields from different entities, so you can give the caption a different value.

Frans Bouma | Lead developer LLBLGen Pro
fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 20-Jun-2011 12:41:41   

Since this functionality is not supported anymore would it be possible to create a custom property for each field?

I seem to only be able to find adding a custom property for the view itself instead of each individual field.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 20-Jun-2011 18:02:48   

You can add them for each field. On the code gen. info tab for the typedview, select the field, then go to the custom properties tab.

If you have hundreds of typedviews, this might be a little tedious. We removed the caption column mostly because it wasn't used in most controls, even if you bound the object to a grid for example. You want to manually read the custom properties and set label texts? Or grid column headers?

Frans Bouma | Lead developer LLBLGen Pro
fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 20-Jun-2011 20:04:12   

I was going to manually set the grid column headers from the created custom property...whatever works at this point.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 21-Jun-2011 09:29:55   

That should be doable. Just define the custom properties as I described, then manually read them from the customproperties property of the typedview instance and set the columns.

Frans Bouma | Lead developer LLBLGen Pro
fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 21-Jun-2011 13:25:20   

I'm not seeing how to add a custom property for each field as you described.

On the "Code gen. info tab" there is a "Custom properties" tab that allows you to add custom properties, however, this only seems to apply to the typed view itself, not to an individual field. I have tried selecting different fields from the "Fields" tab and the left-hand menu, but any properties I have added stay for any field selected, whereas I need a property for each individual field.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 21-Jun-2011 16:26:22   

fluorkin wrote:

I'm not seeing how to add a custom property for each field as you described.

On the "Code gen. info tab" there is a "Custom properties" tab that allows you to add custom properties, however, this only seems to apply to the typed view itself, not to an individual field. I have tried selecting different fields from the "Fields" tab and the left-hand menu, but any properties I have added stay for any field selected, whereas I need a property for each individual field.

On the Code gen. info tab of the typed view editor, you'll see a combo box, which by default selects the typedview itself. When you select a typedview field in that combobox, you can then specify the custom properties for that selected field.

So this isn't the tab in project properties, but the tab on the typedview editor. Right above the tabs 'Setting values', 'Custom properties', Attributes etc. you'll see a combo box. That's the combo box I was referring to simple_smile

As I said above, it might be a bit of a pain to fill in custom properties for a lot of typed view columns.

Frans Bouma | Lead developer LLBLGen Pro
fluorkin
User
Posts: 6
Joined: 16-Jun-2011
# Posted on: 23-Jun-2011 12:38:26   

That did it - thanks for help.

Since I only had less than 20 Typed Views, I edited the XML project file (which is one reason why we switched to 3.1 in the first place) and added all the custom properties from there, which made it much easier and faster. Using the designer first showed me the way.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 23-Jun-2011 16:12:41   

Glad it's solved. We will look into making this less cumbersome in the future. simple_smile

Frans Bouma | Lead developer LLBLGen Pro