CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    1

    WPF Textbox loses original values, even if the user doesn't udpate

    Hi,

    I am having a very strange issue. I have a datagrid which is binding to an observable collection of type Person The selected item is bind to an Object Person. I have 2 textboxes firstname and lastname. When ever user selects an item from grid, the textbox values gets populated. user can edit the values and click submit button, values gets updated.

    Source to Target works correctly - i.e. able to display from viewModel When I update the values gets updated.

    Lets say user selected an item with firstname john, lastname smith The problem is user edits the firstname to johnny and he doesn't click submit button instead he selects a different item from datagrid, so when I go back to the original selected item. In the grid the selected item is shown as John smith, but in the textbox the value is shown as Johnny smith.

    How to solve this problem? Any help would be greatly appreciated.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: WPF Textbox loses original values, even if the user doesn't udpate

    Please zip up and post a sample project that repros the issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured