Calculated cell not updated after converter completed

3 posts, 1 answers
  1. Marcel
    Marcel avatar
    40 posts
    Member since:
    Jan 2014

    Posted 05 May Link to this post

    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. Answer
    Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    370 posts

    Posted 10 May Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Marcel
    Marcel avatar
    40 posts
    Member since:
    Jan 2014

    Posted 11 May in reply to Dilyan Traykov Link to this post

    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

Back to Top