This is a migrated thread and some comments may be shown as answers.

data changes are undone if I select the next record

3 Answers 53 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Richard Koslik
Top achievements
Rank 1
Richard Koslik asked on 03 Nov 2010, 01:00 PM
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

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 04 Nov 2010, 02:36 PM
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
0
Richard Koslik
Top achievements
Rank 1
answered on 12 Nov 2010, 10:41 AM
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
0
Veselin Vasilev
Telerik team
answered on 17 Nov 2010, 04:40 PM
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>>
Tags
GridView
Asked by
Richard Koslik
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Richard Koslik
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or