Column in the main module grid to expose taxonomy value

Posted by Community Admin on 04-Aug-2018 23:11

Column in the main module grid to expose taxonomy value

All Replies

Posted by Community Admin on 05-Jan-2013 00:00

My custom module has taxonomy field (similar to 'Colors' in products sample).
In order to add column to the grid to show taxonomy value I added property to the ItemViewModel class:

public string Color
    get return this.color;
    set this.color = value;

And I read taxonomy value in the contractor:

System.Guid typeTaxa = ((Telerik.OpenAccess.TrackedList<System.Guid>)contentItem.GetValue("Color"))[0];
            type = TaxonomyManager.GetManager().GetTaxon(typeTaxa).Name;

Also I added new column to the Grid that is binded to the new property.

One thing makes me worry:
New property is not really property, it is taxonomy. It is created only as a binding point. So I don't really need setter on this property. Omitting setter breaks functionality.

Is this OK to have setter that doesn't do anything. Please let me know.

Thanks!

Posted by Community Admin on 08-Jan-2013 00:00

Hi Denis,

No, having a setter will not cause any problems. The reason we're adding the get and set is so that the service, which displays the values in each column will have access over the property  or in this case dynamic property. You have probably seen this blog post, but in case you haven't, you might find it useful:

www.sitefinity.com/.../extending_the_built-in_content_modules 

Greetings,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 09-Jan-2013 00:00

Hi Jen,

thank you for confirming. That is what I thought.

Denis.

This thread is closed