BulletGraph & MVVM

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    2 posts
    Member since:
    Feb 2011

    Posted 17 May 2011 Link to this post

    Hello:

    I have tried to use the BulletGraph First Look sample project for the basis of my work; however, I am having serious issues getting the QualitativeRanges to bind properly to my ViewModel. Here is my xaml to aid with your assistance:

    <telerik:RadGridView Grid.Row="1" Name="gridResults" AutoGenerateColumns="False" IsReadOnly="True" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False" ItemsSource="{Binding Data}" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserReorderColumns="False" SelectedItem="{Binding SelectedCoverageMeasure}">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="" UniqueName="DrillDown" Width="Auto" IsFilterable="False" IsResizable="False">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <telerik:RadButton Content="..." Command="{Binding DrillDownCommand, Source={StaticResource coverageViewModel}}" CommandParameter="{Binding}" ToolTipService.ToolTip="View Details"/>
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn Header="Geography" UniqueName="Geography" MinWidth="100" Width="Auto" DataMemberBinding="{Binding Geography}" IsFilterable="True"/>
            <telerik:GridViewDataColumn Header="Plan" UniqueName="Plan" Width="65" DataMemberBinding="{Binding Plan}" IsFilterable="True" />
            <telerik:GridViewDataColumn Header="Actual" UniqueName="Actual" Width="65" DataMemberBinding="{Binding Actual}" IsFilterable="True" />
            <telerik:GridViewDataColumn Header="% of Plan" UniqueName="PercentOfPlan" Width="85" DataMemberBinding="{Binding PercentOfPlanText}" IsFilterable="True" />
            <telerik:GridViewDataColumn Header="Current Status" UniqueName="Status" Width="Auto"  IsFilterable="False" >
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Height="20">
                            <Grid Width="45" Visibility="Collapsed">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding PercentOfPlanText}" />
                            </Grid>
                            <telerik:RadHorizontalBulletGraph Minimum="0" Maximum="100" AutoRange="False" Width="243" QuantitativeScaleVisibility="Collapsed" 
                                                              ComparativeMeasure="{Binding Target}" 
                                                              FeaturedMeasure="{Binding PercentOfPlan}" 
                                                              FeaturedMeasureBrush="{Binding ActualMeasureBrush}"
                                                              QualitativeRanges="{Binding QualitativeRanges}"
                                                              >
                            </telerik:RadHorizontalBulletGraph>
                        </StackPanel>
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn Header="Trend" UniqueName="TrendData" Width="Auto" IsFilterable="False" >
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <telerik:RadLinearSparkline 
                        ShowFirstPointIndicator="True" 
                        ShowLastPointIndicator="True" 
                        ShowHighPointIndicators="True" 
                        ShowLowPointIndicators="True" 
                        ItemsSource="{Binding ActualMeasures}" 
                        XValuePath="Date" 
                        YValuePath="Value" 
                        Width="150" 
                        Height="20" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

    I do have my ViewModel defined within my UserControl.Resources:
    <UserControl.Resources>
        <model:CoverageViewModel x:Key="coverageViewModel" />
    </UserControl.Resources>

    The QualitativeRanges property of my Viewmodel is defined as such:
    public QualitativeRangeCollection QualitativeRanges;

    The collection is being populated, but no qualitative ranges are being displayed in the BulletGraph. I am going crazy trying to figure out why. Does anyone have any ideas?

    Thanks.
  2. Kevin
    Kevin avatar
    2 posts
    Member since:
    Feb 2011

    Posted 17 May 2011 Link to this post

    Well...I have figured out my issue. I had a problem with the QualitativeRanges Property in my DataModel.

    Thanks.
  3. DevCraft banner
Back to Top