Question

I have a Silverlight5 PivotViewer in an MVC4 project that is mainly working, but there's a problem. A few of the properties in the model are defined as List.

[DataContract]
public class PTE_Test
{
    [DataMember]
    public string Name { get; set; }
    [DataMember]
    public string Description { get; set; }
    //...
    [DataMember]
    public List<string> Tags { get; set; }
    [DataMember]
    public List<string> Practices { get; set; }
    [DataMember]
    public List<string> SpecificAreas { get; set; }
}

I want them to be used for filtering and searching, and that actually works great. But it doesn't make sense to base a sort on them (which string in the list do you sort on?). However, not only do they appear in the sort list, but if the user selects one of them, a ManagedRuntimeError exception is thrown.

Does anyone know of a way to control which properties appear in the sort list?

Thanks!

Was it helpful?

Solution

Unfortunately you can't separate out the Sort from the Filter. It's all or nothing.

You can at least address the error the user gets by taking your List and changing it to a custom object and implementing the IComparable interface. I posted a blog post on this topic here : http://tonychampion.net/blog/index.php/2012/02/pivotviewer-multi-valued-properties/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top