Chaging values in grid and BeginInvoke

4 posts, 0 answers
  1. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 27 Jun 2010 Link to this post

    Hi,

    When coming back for a call to WCF, I populate the grid and then after I'm changing some values in it.  The values appears 50% of the time visually but 100% of the time the value is really changed behind the scene in the collection and in the grid but visually it appears only 50% of the time.

    Now I tried with BeginInvoke and it's not appearing 80% of the time.  It's better but still not correct.
    Where do I have to put my code to make 100% sure I will see my change.

    Here's the complete call back :

    private void _Proxy_GetTimesCompleted(object sender, GetTimesCompletedEventArgs e)  
    {  
        if (e.Result.Count > 0)  
            if (e.Result[0].Message != null)  
                if (e.Result[0].Message != "")  
                {  
                    Generics.ShowCursor(thisfalsefalse);  
                    throw new Exception(e.Result[0].Message);  
                }  
     
        _Times = e.Result;  
        rgvTimes.ItemsSource = _Times;  
     
        SetTimesGrid(); // Adding the columns to the grid  
     
        if (SelectedJob != null && SelectedJob.JobStatus == GetJobStatusCode(JOBSTATUS.CREATION_CP))  
        {  
            SelectedJob.JobStatus = GetJobStatusCode(JOBSTATUS.INSTPROD_IP);  
            SelectedJob.JobLineType = GetJobStatusCode(JOBSTATUS.PRODUCTION_P);  
            SelectedJob.JobActive = true;  
     
            //---------------------------------------------------------  
            // Sometimes I have to use the Dispatcher because it does not the job on the Grid  
            // and in this case here, the time was properly set but not visible even with the Rebind
            // The PunchTeam is a method that just change some values in the collection and rebind the grid
     
            //---------------------------------------------------------  
            this.Dispatcher.BeginInvoke(() => PunchTeam(PUNCHTYPE.IN));  
              
            _Proxy.UpdateJobAsync(SecretKey, SelectedJob);  
        }  
     
        SetStartStopButtonState();  
     
        Generics.ShowCursor(thisfalsefalse);  
    }  
     

    PunchTeam is the method that changes some values in the collection and Rebind() the grid.
    I tried to put the code in DataLoaded event with the same problem.

    Thank you
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Jun 2010 Link to this post

    Hi Marc Roussel,

    That sure is a strange behavior. Is it convenient to send us the project so that we can debug it and pinpoint the problem?

    Regards,
    Milan
    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. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 28 Jun 2010 Link to this post

    Since I would have to send you a huge SQL database because without it the project would never start, I will see if I can make a Repro project for you.  If not, and I can't figure out what's wrong, I'll close this request as not reproductible.
  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 29 Jun 2010 Link to this post

    Hi Marc Roussel,

    Ok, we will be waiting for a sample application. In the meantime we will once again try to reproduce the problem.

    Best wishes,
    Milan
    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
Back to Top