Telerik Forums
UI for Silverlight Forum
1 answer
316 views

 I have a long running WCF service and a client that consumes it via WPF. Am using a Progress Bar to notify the client of the percentage completion for a particular process (a method in WCF: I need to be able to display the percentage based on the looping counter in the service)
I have used Background Worker to display progress percentage but it does not display the progress correctly. (displays just 0 and 100 not the in between values) Everything works fine in DEBUG mode but not in RELEASE mode! (Progress bar is updated sequentially in DEBUG mode)

I tried using callbacks/wsDualHttpBinding but have some difficulty in getting this incorporated for all clients. So, had to drop this option.
working on async/await. I have googled quite a few links but nothing helps with my problem.
Please guide me on how to get the current/running value from a method that is not complete yet from a WCF service so I could populate the progress bar percentage based on this value. (in between values)
P.S: WCF service uses wsHttpBinding
sample code below:

public Progress(){// Start the BackgroundWorker. myBGWorker.WorkerReportsProgress = true; myBGWorker.WorkerSupportsCancellation = false; myBGWorker.DoWork += myBGWorker_DoWork; myBGWorker.ProgressChanged += myBGWorker_ProgressChanged;}public void ShowProgress(){ myBGWorker.RunWorkerAsync();}private void myBGWorker_DoWork(object sender, DoWorkEventArgs e){// fetches a static value from the service string value = _client.Progress();int p=0;for (int i = 1; i <= 100; i++){// Report progress. p = Convert.ToInt32(_client.Progress()); _logger.Debug("Progress5:" + p.ToString()); myBGWorker.ReportProgress(p, i);}}private void myBGWorker_ProgressChanged(object sender, ProgressChangedEventArgs e){this.Dispatcher.BeginInvoke(new Action(delegate{ progressBar1.Value = e.ProgressPercentage;}), DispatcherPriority.ContextIdle);}

Martin Ivanov
Telerik team
 answered on 09 May 2017
2 answers
55 views

Hello,

I have a number of progress bars in a bound listbox (MVVM) and I would like to animate each Progress Bar from 0 to "Value" when the Value property changes in the item it is bound to. I understand that I should be using the VisualStateManager but am unsure how to do this with an item in a bound list (I have very little experience with the VisualStateManager and animations).

Would this be possible?

Thanks.

Evgenia
Telerik team
 answered on 31 May 2016
2 answers
78 views
dear all,
 I  run into problem with progressbar .  some time gave progressbar value 0, but it show full progress status. following is code :

var wolist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<workorder>>(e2.Result);
                  
                 
                  List<SaWOProcess> list = new List<SaWOProcess>();
                  lbSaProcess.ItemsSource = null;
                  foreach (var item in wolist)
                  {
                      double v = 0.0;
                      double qty = item.Qty ?? 0.0;
 
                      if (item.CompletedQty != null)
                      {
                          v = (double)item.CompletedQty / (double)item.Qty * 100.0;
                      }
                        
 
                      list.Add(new SaWOProcess() { Qty = qty, WOId = item.Id, WOName = item.WOName, CurrentValue = Convert.ToInt32(v)  , TotalInfo = string.Format("{0}/{1}", item.CompletedQty, qty) });
                        
                      
                  }
          
                  lbSaProcess.ItemsSource = list;
 
                  lbSaProcess.UpdateLayout();



My xaml:

<UserControl.Resources>
 
    <DataTemplate x:Key="dataTemplate">
 
         
            <Canvas  VerticalAlignment="Center"  Margin="10" Height="50"  >
 
                <TextBlock  Foreground="#FF393838" x:Name="loadingPercentage" VerticalAlignment="Center"  Canvas.Top="16" Text="{Binding WOName}"
                    FontSize="15" />
                
                <telerik:RadProgressBar x:Name="pb" Canvas.Top="16" VerticalAlignment="Center" Canvas.Left="100" Width="500" Height="22" Minimum="0" Value="{Binding CurrentValue}"
                Maximum="100"   />
                 
                <TextBlock  Canvas.Left="630"  Canvas.Top="16" VerticalAlignment="Center" Foreground="#FF393838" x:Name="tbTotal" Text="{Binding TotalInfo}"
                    FontSize="15" />
                <Button x:Name="btnViewDetail"  Canvas.Top="16" VerticalAlignment="Center" Tag="{Binding WOId}" Canvas.Left="685"   HorizontalAlignment="Right" Foreground="Black" Content="ViewDetail" Click="btnViewDetail_Click_1" />
 
            </Canvas>
 
        </DataTemplate>
 
 
 
    </UserControl.Resources>
 
 
 
 
        <ListBox Name="lbSaProcess" Grid.Row="1"  ItemTemplate="{StaticResource dataTemplate}" BorderThickness="0" Width="790" Height="750" >
 
  
        </ListBox>

public class SaWOProcess
   {
       public int WOId { get; set; }
       public string WOName { get; set; }
       public int  CurrentValue { get; set; }
       public string TotalInfo { get; set; }
 
       public double Qty { get; set; }
   }

the display result please see attachement.  give the same value some(value= 0 ) progrssbar is ok,others is full progrss status. why?

please help me ,thanks !
cde
Top achievements
Rank 1
 answered on 08 Apr 2013
1 answer
39 views
Hi

I am using RadProgressBar control inside a silverlight child window for a DB search operation, 
My requirement is to close the child window once the search is completed i.e when the progress becomes 100.

i am setting the dialog result value using event trigger
 <i:Interaction.Triggers>
        <ei:PropertyChangedTrigger Binding="{Binding CancelResult}">
            <ei:ChangePropertyAction TargetObject="{Binding ElementName=ProgressBarWindow}" PropertyName="DialogResult" Value="{Binding CancelResult}"/>
        </ei:PropertyChangedTrigger>       
    </i:Interaction.Triggers>

I am able to close the child window using a button 

<Button x:Name="CancelButton" Command="{Binding CancelSearchCommand}" Content="Cancel"   >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:ChangePropertyAction TargetObject="{Binding}" PropertyName="CancelResult" Value="False"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>

But i want to close the window  once the progress completed. so i am setting the CancelResult property to false once 
the progress becomes 100 from the ViewModel, but the window is not getting closed.
Tina Stancheva
Telerik team
 answered on 19 Sep 2012
1 answer
179 views
anyone has a sample for a circular progress bar with a percentage number in the middle?
can this be done with just the styling and don't need code-behind

thanks
Kiril Stanoev
Telerik team
 answered on 13 Jan 2012
3 answers
51 views

Hi,

I have a RadTreeListView and on 'SelectionChanged' event of it, I am calling a webservice and populating the child nodes. Since this webservice takes some time to load , I am using a RadProgressBar to show 'loading' image. Once webservice is over, I am closing the progress bar. Progress bar closes but it doesnt enable the parent window.

 

<

 

 

telerik:RadProgressBar  IsIndeterminate="True" Grid.Column="0" Margin="0,0,0,0" />

Thanks,
Divya

 

Hristo
Telerik team
 answered on 29 Dec 2011
2 answers
34 views
Can you make it look like WP7? Or at least use a solid color instead of the ugly gradients?
Petar Mladenov
Telerik team
 answered on 01 Nov 2011
1 answer
54 views
I would like to have the progress  bar shaped like a ship (ie one end is the pointy bow rather than rectangular). Is this possible with the telerik progress bar control

Rgds
Douglas
Petar Mladenov
Telerik team
 answered on 14 Sep 2011
1 answer
98 views
Hi guys,

Is it possible to make a multi color'd progress bar, meaning divided into segments with the telerik progress bar?
If it is can you give me an example?

Many thanks,
Cyrus
Petar Mladenov
Telerik team
 answered on 20 Jun 2011
3 answers
134 views
Hi,

I have a Rad Progress Bar on my Silverlight Application. 
I run 6 services and set my progress bar from 0 to 100% on UI Thread.

In the first time i run it, it works, on the 2nd time the progress bar never leave the 100% style state, but the value goes from 0 to 100. 
Petar Mladenov
Telerik team
 answered on 12 Apr 2011
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?