Hello,
Is - it possible to use XamWebGauge in a ItemControl and "Binding" EndValue and StartValue ?
Presently, i got an error.
Thanks.
yes, it is possible. here's some code to get you started.
<ListBox Height="300" Width="300" Background="Pink" > <ListBox.ItemsSource> <local:MyData /> </ListBox.ItemsSource> <ListBox.ItemTemplate> <DataTemplate> <igGauge:XamWebRadialGauge Height="100" Width="100"> <igGauge:XamWebRadialGauge.Scales> <igGauge:RadialGaugeScale StartValue="{Binding StartValue}" EndValue="{Binding EndValue}"> <igGauge:RadialGaugeScale.LabelGroups> <igGauge:RadialGaugeLabelGroup /> </igGauge:RadialGaugeScale.LabelGroups> </igGauge:RadialGaugeScale> </igGauge:XamWebRadialGauge.Scales> </igGauge:XamWebRadialGauge> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
public class Widget { public double StartValue { get; set; } public double EndValue { get; set; } } public class MyData : ObservableCollection<Widget> { public MyData() : base() { this.Add(new Widget() { StartValue = 1, EndValue = 2 }); this.Add(new Widget() { StartValue = 3, EndValue = 4 }); this.Add(new Widget() { StartValue = 5, EndValue = 6 }); } }
Actually, I tested your code sample with little modifications:
<Grid x:Name="LayoutRoot" Background="White"> <ItemsControl x:Name="list" Height="300" Width="300" Background="Pink" > <ItemsControl.ItemTemplate> <DataTemplate> <igGauge:XamWebRadialGauge Height="100" Width="100"> <igGauge:XamWebRadialGauge.Scales> <igGauge:RadialGaugeScale StartValue="{Binding StartValue}" EndValue="{Binding EndValue}"> <igGauge:RadialGaugeScale.LabelGroups> <igGauge:RadialGaugeLabelGroup /> </igGauge:RadialGaugeScale.LabelGroups> </igGauge:RadialGaugeScale> </igGauge:XamWebRadialGauge.Scales> </igGauge:XamWebRadialGauge> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl></Grid>
public TestGauge(){ InitializeComponent(); list.ItemsSource = new MyData();}public class MyData : ObservableCollection<Widget>{ public MyData(): base() { this.Add(new Widget() { StartValue = 1, EndValue = 2 }); this.Add(new Widget() { StartValue = 3, EndValue = 4 }); this.Add(new Widget() { StartValue = 5, EndValue = 6 }); }}public class Widget{ public double StartValue { get; set; } public double EndValue { get; set; }}
i got this error, and even with your original sample:
AG_E_PARSER_BAD_PROPERTY_VALUE
Are you able tou reproduce it? or i missed a thing ?Help me...
Thanks a lot.
i found why...
Actually i worked on the 2009.1 version, and this bug was fixed in the last release 2009.2.
Thank you david!
it worked okay for me. i have attached the sample project.
does the parser error point to a particular line number?