faceted object

2 posts, 0 answers
  1. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 26 Aug 2013 Link to this post

    Hi,

    I am using this:
    http://www.damonpayne.com/post/2011/04/14/Using-ICustomTypeProvider-in-Silverlight-5.aspx

    I am generating itemsSource like this:

    for

     

     

    (int i = 0; i < dtData.Rows.Count; i++)

     

    {

    dataRow = dtData.Rows[i];

    vmNuggetResult =

     

    VmNugget.GetInstance((long)dataRow[1]);

     

    vmNuggetResult.Id = (

     

    long)dataRow[0];

     

    vmNuggetResult.NuggetType =

     

    new VmNugget() { Id = (long)dataRow[1], Name = (string)dataRow[2] };

     

    vmNuggetResult.Author =

     

    new VmNugget() { Id = (long)dataRow[3], Name = (string)dataRow[4] };

     

     

     

    if (!dataRow.IsNull(5))

     

    vmNuggetResult.Created = (

     

    DateTime)dataRow[5];

     

     

     

    // facets

     

    vmNuggetResult.Cols.AddFacet(

     

    "name", typeof(string));

     

     

     

    if (!dataRow.IsNull(6))

     

    vmNuggetResult.Cols[

     

    "name"] = (string)dataRow[6];

     

    vmNuggetResult.Cols.AddFacet(

     

    "description", typeof(string));

     

     

     

    if (!dataRow.IsNull(7))

     

    vmNuggetResult.Cols[

     

    "description"] = (string)dataRow[7];

     

     

     

    this.vmQueryExecuted.Rows.Add(vmNuggetResult);

     

    }



    As you can see, I am adding two dynamic properties to Cols (typeof = FacetedObject). Both of type string.

    I am generating datatemplate dynamically on the server and loding it with

    XamlReader

     

     

    .Load

     


    My dataTemplate looks like that:

    vmQuery.ContentControlXamlStyle =

    @"

    <DataTemplate

    xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""

    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""

    xmlns:converters=""clr-namespace:SUS.Assets.Converters;assembly=SUS""

    xmlns:selectors=""clr-namespace:SUS.Assets.DataTemplateSelectors;assembly=SUS""

    xmlns:telerik=""http://schemas.telerik.com/2008/xaml/presentation""

    xmlns:helpers=""clr-namespace:SUS.Assets.Helpers;assembly=SUS""

    >

    <telerik:RadGridView IsReadOnly=""True"" AutoGenerateColumns=""False"" ItemsSource=""{Binding Rows}""

    helpers:TelerikGridHelper.Grid=""{Binding RelativeSource={RelativeSource Self}}""

    >

    <telerik:RadGridView.Columns>

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding Id}"" Header=""Id"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding NuggetType.Id}"" Header=""NuggetTypeId"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding NuggetType.Name}"" Header=""Typ příspěvku"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding Author.Name}"" Header=""Autor"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding Created}"" Header=""Vytvořeno"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding Cols.name}"" Header=""Pojem"" />

    <telerik:GridViewDataColumn DataMemberBinding=""{Binding Cols.description}"" Header=""Výklad"" />

    </telerik:RadGridView.Columns>

    </telerik:RadGridView>

    </DataTemplate>

    "

     

     

    ;

     



    The problem is, that although the faceted columns are populated, it is not possible to use them to filter, order or group data.

    Do you know, where is the problem please?

    I have thought it is possible to use your grid with a  faceted object.

    Thank you.

    Tom












  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 27 Aug 2013 Link to this post

    Hello,

    We use LINQ for sorting, filtering and grouping so you will have to hint the dynamic columns about the actual data type they will show by setting their DataType property. If this does not help, can you please prepare and attach a dummy project which we can debug locally to see what is going on inside the data engine. Thanks in advance.

    Regards,
    Rossen Hristov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top