Note that there are some explanatory texts on larger screens.

plurals
  1. POTelerik RadGauge + Data Binding
    primarykey
    data
    text
    <p>So I'm trying to update my RadRadialGauge. It will display data (using an animated Needle) that is being retrieved on a real-time basis. I have a RadChartView that currently works by using <code>TimeStamp</code> and <code>Value</code> properties to draw the Chart. When I add a chart, sometimes I might want to add a few based on the variable I'm watching. For instance, if I want to watch Motor Speed and Output Frequency, I have to add multiple vertical axes. Part of my code to handle the data binding for the RadChartView is here:</p> <pre><code>var lineSeries = new LineSeries(); lineSeries.CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "TimeStamp" }; lineSeries.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "Value" }; lineSeries.ItemsSource = (chart.Chart as GuiAnalogQueue).Records; </code></pre> <p>The rest of the code is just appearance handling, and then at the end I add the LineSeries to my RadChartView. </p> <p>Now, I'm trying to port this code, in a way, over to RadGauge. I'm not sure how to bind the values to the Needle so the needle moves when the Value changes.<br> In the XAML I've tried <code>Value="{Binding Value}"</code> I've tried adding binding to the <code>ValueSource</code> varible. Also I have done <code>needle.Value = chart.Chart.Value;</code></p> <p>I can't figure it out, so any help is appreciated.</p> <p><strong>UPDATE</strong></p> <p>This is what I'm trying to accomplish. My <code>Records</code> collection has two properties, <code>Value</code> and <code>TimeStamp</code>. I'm trying to bind my <code>Value</code> in the <code>Records</code> to the <code>needle</code> Value. This is my approach to do it programmatically:</p> <pre><code>public void InitializeCharts(ChartsVM charts, Theme theme) { DataContext = charts; foreach (cVM chart in charts.Charts) { Binding value = new Binding(); value.Source = (chart.Chart as GuiAnalogQueue).Records; value.Path = new PropertyPath("Value"); needle.SetBinding(Needle.ValueProperty, value); } } </code></pre> <p>However, when I do this, it is not changing the <code>needle.Value</code> at all. My <code>Records</code> is the collection that uses NotifyPropertyChanged("Records"), so I would expect my needle to change everytime Records is changed. </p> <p>As you see in my original post, those three lines take care of binding the variables to ChartView charts, however I can't get the RadGauge to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload