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

Calculated cell not updated after converter completed

2 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 05 May 2016, 02:42 PM

Hello,

 

I have a column in which I use a converter to create a string based on some value that where inputted by the user. I attached this converter to my column using the code below:

DataMemberBinding="{Binding Path=., Converter={StaticResource MyConverter}}"

 

When I debug the code I can see the converter is running for the particular cell and generating a value thats specific for that row, but the cell itself is not updated with the new value, it remains empty?

The user is not able to enter data in this cell or set the focus, because the property IsReadOnly is set and I skip the cell during input, the values the user input are in inputted in a seperate dialog, after this dialog is closed the focus moves automatically to the cell next to it.

Am I forgetting here something to commit, it seems a very simple problem but I cant find it?

Regards,

 

Marcel

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 10 May 2016, 09:55 AM
Hello Marcel,

RadGridView has two ways of refreshing the UI after changes in data. 
1. Through the INotifyPropertyChanged interface
2. By calling the Rebind() method.

Using INotifyPropertyChanged is only applicable when you bind to a property (not the entire object). Correct me if I'm wrong, but I believe this is not the case in your scenario. One suggestion I can make is to introduce a separate property of your business object, holding the logic of the converter. You can then bind your column to that property and RadGridView should automatically update the cell value.

Another approach I can suggest is to call the Rebind() method of RadGridView after a change in the data has been made.

Could you please give both approaches a try and let me know how it goes?

Regards,
Dilyan Traykov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Marcel
Top achievements
Rank 1
answered on 11 May 2016, 06:08 AM

Hello Dilyan,

 

I tried before using the INotifyPropertyChanged and  a separate property on my object, this was not working then. I now figured it out, I made a small mistake in the XAML, thats why it was not working.

I have implemented it with the INotifyPropertyChanged and it works fine now!

Thanks for the support.

 

Regards,

Marcel

Tags
GridView
Asked by
Marcel
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or