This question is locked. New answers and comments are not allowed.
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 :
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
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(this, false, false); |
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(this, false, false); |
} |
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