Force refresh of values?

3 posts, 0 answers
  1. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 03 Feb 2011 Link to this post

    Hi all.

    I have a radgrid that binds to a entity. I have a partial class that does some calculations, example field being 'mycount'. This field is shown correctly in the grid, however when a certain property updates I want this value to update. However when I go back to the grid the old value is there, until I navigate around the system and the context refreshes itself. Thus it field "x" changes I need the value of "mycount" to be updated. Could someone throw some light on this;

    [global::System.Runtime.Serialization.DataMemberAttribute()]
           public int mycount
           {
               get
               {
                   try
                   {
                       return  this.MyChildEntity.Count;
                   }
                   catch (Exception ex)
                   {
                       return 0;
                   }
               }
           }
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Feb 2011 Link to this post

    Hello madladuk,

     You need to implement INotifyPropertyChanged for this object and raise PropertyChanged event when needed. 

    Greetings,
    Vlad
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 04 Feb 2011 Link to this post

    Hi could you give me some examples. Basically when the property "userstatus" changes I want to update the property "mycount", however you can see that this is a readonly field at the moment as this is not something the user updates but it used to provide an active count [plus some other functions]. I did try something like this but found that it still did not update the value

    protected override void OnPropertyChanging(string property)
           {
               if (property == "managerstatus") base.ReportPropertyChanged("mycount");
               base.OnPropertyChanging(property);
           }

    Thanks P
Back to Top