Column in the main module grid to expose taxonomy value
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;
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!
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
Hi Jen,
thank you for confirming. That is what I thought.
Denis.