Home Forums WPF controls Xceed DataGrid for WPF Editing my DataGrid

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064

    I tried that.
    My items are from an XML file.
    The collection may be called <Collection> </Collection>
    Items are inside this collection and each item may looks like <Item> <Column1/> <Column2/> </Item>

    DisplayMemberBinding=”{Binding Column1}” does not work
    nor DisplayMemberBinding=”{Binding Item/Column1}”
    nor DisplayMemberBinding=”{Binding Path=”Column1″}”

    Imported from legacy forums. Posted by valentin (had 837 views)

    Xceed Support
    Member
    Post count: 5658

    If you are binding your grid to, for example, a ListCollectionView that wraps the DefaultView of the DataTablem, then each item in the grid will be a DataRowView rather than a System.Data.DataRow. If this is the case, using DisplayMemberBinding=”{Binding Column1}” should work fine.

    If you are binding directly to the DataTable, then the items are System.Data.DataRows and you should therefore bind to the indexer. For example: DisplayMemberBinding=”{Binding [Column1]}”.

    Can you show me the code you are using to bind the grid?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 435 views)

    User (Old forums)
    Member
    Post count: 23064

    Okay,
    I did not know the second way to do that.
    I just tried: DisplayMemberBinding=”{Binding [Column1]}” and it ran nicely.
    Do you wanna see the code anyway?!

    Thanks for all, you’re really patient and qualified!

    Sad.

    Imported from legacy forums. Posted by valentin (had 884 views)

    Xceed Support
    Member
    Post count: 5658

    No need 🙂 Thanks!

    Imported from legacy forums. Posted by Jenny [Xceed] (had 11600 views)

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