This is a migrated thread and some comments may be shown as answers.

DataBinding RadGridView in TileView

2 Answers 92 Views
TileView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rick
Top achievements
Rank 1
Rick asked on 01 Jun 2012, 04:27 PM
I have a RadTileView using the RadFluidContentControl. Everything is working well and I can bind to my ProductTile collection in my ViewModel and have no problems displaying properties from the ProductItem object that is a member of my ProductTile class. The XAML below works fine

                     
<Border BorderBrush="DarkGray" BorderThickness="1" CornerRadius="3" Grid.Row="6" Grid.Column="1" Height="20">
     <Border.Background>
         <ImageBrush ImageSource="/SilverlightApplication1;component/Images/FrostedGlass0002.png" Opacity=".7"></ImageBrush>
     </Border.Background>
     <TextBlock  HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=productItem.productPrice}"></TextBlock>
 </Border>

I am having a problem displaying any of the ProductItem properties inside a RadgridView. The XAML below does not display anything nor does the CellTemplateSelector get called

<Border BorderBrush="DarkGray" BorderThickness="1" CornerRadius="3" Grid.Row="7" Grid.Column="1" Height="20">
    <Border.Background>
        <ImageBrush ImageSource="/SilverlightApplication1;component/Images/FrostedGlass0002.png" Opacity=".7"></ImageBrush>
    </Border.Background>
    <telerik:RadGridView AutoGenerateColumns="False"
                         Background="Transparent"
                         IsReadOnly="True"
                         ShowColumnHeaders="False" ShowColumnFooters="False"
                         ShowGroupPanel="False"  >
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding productItem.productRebate}" Header="Rebate"  CellTemplateSelector="{StaticResource productOfferTemplateSelector}"></telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding productItem.productSpecialOffer}"  CellTemplateSelector="{StaticResource productOfferTemplateSelector}"></telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding productDiscount}" CellTemplateSelector="{StaticResource productOfferTemplateSelector}"></telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
     </telerik:RadGridView>
</Border>

what have I missed?

Thanks in Advance


2 Answers, 1 is accepted

Sort by
0
Rick
Top achievements
Rank 1
answered on 04 Jun 2012, 04:51 PM
I have resolved the issue with DataBinding the ItemsSource in the RadGridView. I added an ObservableCollection<ProductItem> to my ViewModel that the RadTileItem was bound to. Now I can set the ItemSource to this and all my bindings work.

Thanks

Rick
0
Zarko
Telerik team
answered on 05 Jun 2012, 12:42 PM
Hello Rick,
We're glad that you we able to resolve your problem and if you have further questions please feel fee to ask.

Greetings,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TileView
Asked by
Rick
Top achievements
Rank 1
Answers by
Rick
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or