Home Forums WPF controls Xceed DataGrid for WPF How to display the current cell in textbox

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

    I’m very new to WPF, so spare me if this is a dumb question.

    This is my situation:

    I have a window with a tab control with 2 tabs (master, detail)
    The master tab holds the datagrid.
    The detailed tab holds every field from my datasource for the current record.
    Since i have 20+ fields in the dataset, i only show the most important fields in the grid.

    The problem:
    I just can’t seem to bind a textbox to the current value of a cell for the current item.
    I tried the following:
    <TextBox Text=”{Binding ElementName=grid, Path=CurrentItem.ProductName}”/>
    <TextBox Text=”{Binding ElementName=grid, Path=ProductName}”/>

    None of them seems to work.

    Thanks in advance for any help.

    Imported from legacy forums. Posted by averbeka (had 2592 views)

    Xceed Support
    Member
    Post count: 5658

    Try accessing ProductName through the indexer:

    <TextBox Text=”{Binding ElementName=grid, Path=CurrentItem[ProductName]}”/>

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

    User (Old forums)
    Member
    Post count: 23064

    Thanks Jenny, works like a charm.

    Imported from legacy forums. Posted by averbeka (had 3482 views)

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