data changes are undone if I select the next record

4 posts, 0 answers
  1. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 03 Nov 2010 Link to this post

    Hello,

    The problem is the following: We have a RadGridView which displays an overview of data. Beside the grid we show all detail fields, where you can edit the data. My problem is now, if I edit the field data for example of a "TEXTBOX" element and then I click in the gridview onto the next record the data is not saved on the client side. If I click in the gridview onto the same record as displayed in detail or into another detail field the new data is saved on client side.

    The crazy thing is if I edit a "CHECKBOX" and then I click onto the next record in the gridview the data is saved. What is the difference between those elements? Has anyone an idea if this is a bug of the RadGridView or something else?

    Thanks for your help.

    Best regards, Richard
  2. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 04 Nov 2010 Link to this post

    Hi Richard Koslik,

    TextBox updates its binding source value on lost focus by default (and in Silverlight you cannot change this behavior except to update value explicitly), while checkbox updates its source on PropertyChange. Unfortunately this lost focus event occurs just after when next control got focus and your textbox text is already changed. You could work around this issue by creating a CustomTextBoxBehavior which do almost the same like UpdateSourceTrigger.PropertyChanged in WPF.

    I'm attaching a sample project that demonstrates this approach. Let me know how it works on your end.

    Best wishes,
    Nedyalko Nikolov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 12 Nov 2010 Link to this post

    Hello,

    I tried it out, but it doesn't work good. I was able to set my data, but it was sent currently to the server, where the database was also updated. The data should only be saved in the selectedItem, so that I can make a RejectChanges.
    Maybe I made a mistake or have something misunderstood?

    Best regards, Richard
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 17 Nov 2010 Link to this post

    Hi Richard Koslik,

    Do you use WCF Ria Services? If so, the new data will not be sent back to the server until you call the SubmitChanges() method of the DomainDataSource. So, if you do not submit the changes they are saved only in RadGridView. I think this is what you want.

    Maybe your scenario is a bit different? In that case please open a support ticket and attach a sample project there so we can have a better idea of what is going on.


    Regards,
    Veselin Vasilev
    the Telerik team
    See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Back to Top