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

Chaging values in grid and BeginInvoke

3 Answers 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marc Roussel
Top achievements
Rank 2
Marc Roussel asked on 27 Jun 2010, 12:16 PM
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

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 28 Jun 2010, 07:37 PM
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
0
Marc Roussel
Top achievements
Rank 2
answered on 28 Jun 2010, 08:14 PM
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.
0
Milan
Telerik team
answered on 29 Jun 2010, 10:01 AM
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
Tags
GridView
Asked by
Marc Roussel
Top achievements
Rank 2
Answers by
Milan
Telerik team
Marc Roussel
Top achievements
Rank 2
Share this question
or