Home Forums WPF controls Xceed DataGrid for WPF Can ChildColumnNames accept FieldName with dot(.)?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #41552 |

    Suppose I have data to bind to the DataGrid which is instance of class like

    class Workdata {

      public int a;

    public int b;

    public Person c; 

     class Person {

    public string name;

    public int age;

    public string phone; 

    } 

    then I bind each field to the grid like

    <xcdg:Column FieldName=”a” />

    <xcdg:Column FieldName=”b” />

    <xcdg:Column FieldName=”c.name” />

    <xcdg:Column FieldName=”c.age” />

    <xcdg:Column FieldName=”c.phone” />

     And this works.

    Now what I want to do is to have the columns of “C”(only header) to be merged like

    <xcdg:MergedHeader> 

    <xcdg:MergedColumn FieldName=”g2″ Title=”Person” ChildColumnNames=”c.name, c.age, c.phone” CellHorizontalContentAlignment=”Center” />

    </xcdg:MergedHeader> 

     It doesn’t work. Any advise? 

    Imported from legacy forums. Posted by Jaiwei (had 65 views)

    User (Old forums)
    Member
    Post count: 23064

    Also I have the same problem of this post http://xceed.com/CS/forums/thread/27452.aspx

    If I typed something like

    <xcdg:SumFunction ResultPropertyName="age_sum" SourcePropertyName="c.age"/>
     
    I will get an exception. 

    Imported from legacy forums. Posted by Jaiwei (had 16 views)

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

     

    Can you send me a simple stand alone sample project which reproduces these issues so that I could have a closer look. You may send it to support@xceed.com

    Imported from legacy forums. Posted by Fawzi [Xceed] (had 33 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for Fawzi there is a workout for the MergedColumn issue: Use double quotes 

    For example in xaml :

    ChildColumnNames=”&quot;p.name&quot;
    &quot;p.age&quot; &quot;p.phone&quot;”

    Or in code behind
    :

    MergedColumn.ChildColumnNames = “\”p.name\”; \”p.age\”
    \”p.phone\””;

     

    And for the statFunctions issue the workout is: Use DataGridItemProperty to help the DataGridCollectionView extract values from sub-properties

     in code behind :

     DataGridCollectionView i = new DataGridCollectionView(datasrc);

     i.ItemProperties.Add(new DataGridItemProperty(“p.age”, typeof(int)));

     

    Imported from legacy forums. Posted by Jaiwei (had 28 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.