Hi,
I have created a custom progress bar usercontrol using RadProgressArea. I have placed this control in one of my web page. On a button click event a usercontrol method will be triggered. This method in turn will trigger the UpdateProgressContext method for setting the Radprogresscontext. The progress percentage will be retrieved using progressMethod. The RadProgressBar is getting displayed.
But if I try to call the UpdateProgressContext method asynchronously using delegate, my progressbar itself is not displayed. This is my code.
private delegate void BeginProgress(Progress prog);
public Update(Progress progressMethod)
{
BeginProgress beginUpdate = new BeginProgress(UpdateProgressContext);
beginUpdate.BeginInvoke(progressMethod, new AsyncCallback(ProgressCallbackMethod), new object());
}
private void UpdateProgressContext(Progress progressMethod)
{
int currentPercentage = 0;
const int total = 100;
while (currentPercentage <= 100)
{
currentPercentage = progressMethod();
radProgress.Speed = "N/A";
radProgress.PrimaryTotal = 1;
radProgress.PrimaryValue = 1;
radProgress.PrimaryPercent = 100;
radProgress.SecondaryTotal = total;
radProgress.SecondaryValue = currentPercentage;
radProgress.SecondaryPercent = currentPercentage;
radProgress.CurrentOperationText = "Step " + currentPercentage.ToString();
radProgress.TimeEstimated = (total - currentPercentage) * 100;
}
}
Any help will be appreciated. Thanks in advance.
Regards,
Subbu