Developer forum

Forum » Development » CodeFirst ItemTypes use a combination of fields for display

CodeFirst ItemTypes use a combination of fields for display

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I was wondering if there is a way to use a combination of fields for display in a Checkbox list.

I have a checkbox list that is built based on the list of ItemTypes available for an area and from what I understand, I can only choose a field for the value to be stored and a field for the Label.
I was wondering if I can combine 2 fields to be displayed as Label.

Thank you,

Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

One more thing.

Would it be possible to define a Hidden field and save the combination of fields into it upon save of the Item?

For example, if I have Code [text],Name[text],Label[hidden] can I save Code+name into the Label field when the Item is saved?

Thank you,

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Anybody?

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Adrian,

Try this in your code first item...

[HiddenField]
public string Label
{
    get { return string.Join(" ", Code, Name); }
    set { }
}

Best regards,
Morten

 

You must be logged in to post in the forum