This is a migrated thread and some comments may be shown as answers.
Dynamic Tiles
10 Answers 130 Views
This is a migrated thread and some comments may be shown as answers.
veera
Top achievements
Rank 1
veera asked on 14 Jun 2011, 10:15 AM
Hi Telerik,

I have a requirement as below.

My Use case : 

 I need to impliment a Dashboard to display user info in format of grids,charts etc.lets take an example My Notes ,My Info etc are the tiles need to display in my dashboard.Also admin will set up witch tiles will display to witch user.All these values will be saved in database.for example user 1 can able to see My Notes tile only and User2 will see both My Notes and My Info tiles.Also user can change the postion of tiles etc.In My database DashBoard table contain userID and TileName etc.so i need to add dynamically the tiles into my dashboard.Also need to save tile postions like ordinal and Maiximized or not etc.

So My Idea is to create 2 user controls as MyNotes and My Info and get data based on user id and require params.And wile loading the DashBoard page dynamically load these user controls based on Available tilenames tile state and ordinal.

Is it correct way to complete this requirement?.Any Idea/examples to start up my requirement?

Thanks in advance
Vru

10 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 16 Jun 2011, 11:59 AM
Hi veera,
Your plan sounds right to me, but I can advise you to try our new PersistenceFramework which will be available from the Q2 2011 Beta. With it I think it will be easier for you to save the whole user layout and then load it again. I've created a simple project which saves the current layout (without the PersistenceFramework) so you could examine it and see if this is what you're looking for.
If you have more questions feel free to ask.

Kind regards,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
veera
Top achievements
Rank 1
answered on 16 Jun 2011, 02:26 PM
Hi Zarko,

Looks Good ....

Any Idea when Q2 version will be released?



Thanks for your  help
Vruk
0
Zarko
Telerik team
answered on 16 Jun 2011, 04:39 PM
Hello veera,
The Q2 2011 Beta should be available some time next week.

Regards,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
veera
Top achievements
Rank 1
answered on 20 Jun 2011, 09:24 AM
Hi Zarko,

Can i use MVVM approach for this?I am planing to place these objects into tileview using Reflection.

Idea will be :

MyTile usercontrol and model contains all Properties(maximized ,minimized etc) related to tileview item.

My grid data will be added to tileview item and all tileview items will be added to tileview control.

Thanks
Vru
0
Zarko
Telerik team
answered on 21 Jun 2011, 11:46 AM
Hello veera,
Yes, and in that case you can directly bind the Position, TileState etc. properties that you're interested in to some properties in your business object with container bindings like this:
<telerik:RadTileView x:Name="myTileView"
                      Grid.Row="1"
                      MinimizedColumnWidth="250">
    <telerik:RadTileView.ItemTemplate>
        <DataTemplate telerik:ContainerBinding.ContainerBindings="{StaticResource bindings}">
            <TextBlock Text="{Binding Header}" />
        </DataTemplate>
    </telerik:RadTileView.ItemTemplate>
      ....
</telerik:RadTileView>

<telerik:ContainerBindingCollection x:Key="bindings">
    <telerik:ContainerBinding Binding="{Binding ItemPosition, Mode=TwoWay}" PropertyName="Position" />
    <telerik:ContainerBinding Binding="{Binding ItemTileState, Mode=TwoWay}" PropertyName="TileState" />
</telerik:ContainerBindingCollection>
If you have further questions feel free to ask.

Regards,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
veera
Top achievements
Rank 1
answered on 23 Jun 2011, 11:29 AM
Hi Zarko,

My question is it possible to place diff types of items into tileviewitem as in below appraoch/use case?
i am little bit confused over your option given on previous reply,
.I mean i have a mian page.xaml continea tileview and one usercontrols MyCtl.Xaml TileViewItem with respective properties in Tileview model.And 2 user controls simple a Conrol1.xaml other is  Conrol2.xaml and those containes diff viewmodels.in main page.xaml i wll place

Ex :
class TileViewItemModel
{
  Position
  TileState
}

Class SubModel
{
  UserControlName
  List<TileViewModel>
}

Class MianViewModel
{
List<MainModel>
}

So from database i will get List<SubModel> .ex

   Control1, TileviewItemProperties
   Control2,TileviewItemProperties

so I i need to instantiate Tileview i.e MyCtl and add instantiate control1 and add it to that.
ex : 
Lopp throught  List<SubModel> and
 MyCtl m = new MyCtl();
 M.Context = TileviewItemProperties
 control1 c = new control1();
 (data to control will be static for now)
 M.Items.Add(c);

This is my stategy for this.
My Doubts is this approach will be supported by Telerick contols vs MVVM?(dynamic templating)
also any better thoughts on top of this?.


Thanks for your help
Vru



0
Accepted
Zarko
Telerik team
answered on 24 Jun 2011, 04:34 PM
Hi veera,
If I understand you correctly, you get the SubModels from your DataBase and you want to create RadTileViewItems from this information. If this is the case I think that the best aproach is to bind the RadTileViews ItemsSource property to SubModels collection and by using Templates, ContainerBindings and one converter ( to convert the UserControl name to actual UserControl) you can generate everything you need. When you're using MVVM pattern its a good practice to avoid having ui elements in your VIewModels and thats why I use converter to generate the UserControls.
Could you please examine the attached project and see if this is what you're looking for?

All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mallik
Top achievements
Rank 1
answered on 01 Jul 2011, 01:05 PM
Hi,

This req is very much similar to me.But i am loading grids and Radfluid controls (for three modes) and also  need to enable scrolling to Tileview item diplay all rows and columns in a grids.

so any help on this?



Thanks
Mallik sharma
0
veera
Top achievements
Rank 1
answered on 03 Jul 2011, 02:45 PM
you can use

<ScrollViewer x:Name="ScrollBox" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">


Thanks
Veera
0
Zarko
Telerik team
answered on 06 Jul 2011, 04:41 PM
Hello Mallik,
As Veera suggested if the content of the RadTileViewItem is bigger than the item you should use a ScrollViewer to wrap the content.
For further references could you please examine the attached project and if you have more questions feel free to ask.

All the best,
Zarko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Asked by
veera
Top achievements
Rank 1
Answers by
Zarko
Telerik team
veera
Top achievements
Rank 1
Mallik
Top achievements
Rank 1
Share this question
or