Home Forums WPF controls Xceed DataGrid for WPF binding multiple DataTables to a grid?

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

    hi,

    i need to bind multiple related DataTables to a grid and i have no idea how to do.

    is it possible?
    any suggestions?

    thanks a lot, k.

    Imported from legacy forums. Posted by noname (had 2365 views)

    User (Old forums)
    Member
    Post count: 23064

    k,

    Did you find a solution to this question? I have the same situation. I have multiple tables that I need to present based on menu selections and then present populated forms based on the contents of the grid row. There are a number of forms that are similar but don’t have all the same fields. I can’t see placing multiple grids just to display different tables.

    I tried to set multiple x:key… Source=”{Binding Path… entries but it crashed the Visual Studio IDE – that was not nice.

    kj

    Imported from legacy forums. Posted by Ken (had 429 views)

    User (Old forums)
    Member
    Post count: 23064

    Actually, I got it! It wasn’t that hard but I had to do the edit outside the VS 2008 IDE in order for it not to crash. Look at this.

    <Grid.Resources>
    <xcdg:DataGridCollectionViewSource x:Key=”Data12345″ Source=”{Binding Path=form_12345}” />
    <xcdg:DataGridCollectionViewSource x:Key=”Data23456″ Source=”{Binding Path=form_23456}” />
    </Grid.Resources>

    Then I placed this code in my VB codebehind

    Public Shared ReadOnly Property form_12345() As DataTable
    Get
    Return m_form_12345
    End Get
    End Property

    Private Shared m_form_12345 As DataTable

    Public Shared ReadOnly Property form_23456() As DataTable
    Get
    Return m_form_23456
    End Get
    End Property

    Private Shared m_form_23456As DataTable

    Then build the event handlers for the grid under the different names.

    It works like a charm!

    kj

    Imported from legacy forums. Posted by Ken (had 3391 views)

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