Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Need grid to be column centric and not row centric
posted

 

We have a class called TestData which contains a string called Header and a list of doubles called Data.  We then add several of these TestData objects to an ObservableCollection<TestData> called UberData. As new data becomes available at run time, we either add items to the Data list of an existing TestData object in the UberData collection , or we add an entirely new TestData object to the collection.  For example we might have an ObservableCollection<TestData> that contains TestData.Header = “Channel1” and TestData.Header=”Channel2”, etc.

 

 

We would like to databind the first column of the grid to the Data list for channel 1, inside the UberData collection, and the second column of the grid to the Data list object for channel 2 etc. In the binding we would like to bind the grids column 1 header to TestData.Header and the data for the grid column to TestData.Data.

 

Is this possible? We have failed to do this with the Microsoft WPF Grid. The general problem has been that we don't know how many collections will be inside the Uber collection as it is dynamic i.e. we don't know how many at design time.

 

The MS Grid control has this behaviour: A data row is created for each object in the collection, and a column is created for each property. The values of the cells in each data row correspond to the property value of each object.

 

Our data is column centric. We need a column for each object in the collection. Another way to put this is I have 3 arrays of doubles how do I get array 1 to show in column 1 and array 2 to show in column 2 etc.

 

Thanks

 

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello John,

     

    Thank you for your post. I have been looking into it and I can suggest you set the XamDataGrid’s ViewSettings’ Orientation to Horizontal like this:

    <igDP:XamDataGrid.ViewSettings>
        <igDP:GridViewSettings Orientation="Horizontal"/>
    </igDP:XamDataGrid.ViewSettings>
    

    Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

Children