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

About Adding and deleting RadTileViewItem dynamically

5 Answers 102 Views
TileView
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 04 Nov 2011, 07:59 PM
I have a requirement as below.

Binding a data source to RadTileView, in every  RadTileViewItem there are a ADD button and DELETE button, Clicking the ADD button will open a new RadTileViewItem so user can input new data, now i can't make the new RadTileViewItem maximize, this is my first question; My second question is how could i get some binding information, such as itemid of the current record, when i click DELETE button so i can delete from DB by this condition.

Thanks.


5 Answers, 1 is accepted

Sort by
0
L
Top achievements
Rank 1
answered on 07 Nov 2011, 04:54 PM
I tried to use ItemContainerGenerator.ContainerFromItem(NewItem) to find the new TileviewItem, However it's null.

0
Tina Stancheva
Telerik team
answered on 09 Nov 2011, 03:13 PM
Hi L,

I am not sure how you implement your scenario but if you use an MVVM approach - binding the RadTileView ItemsSource, you can examine the attached sample. Using DelagateCommands to implement the Add/Delete behavior can help you work only with the business data. Also, you can bind the TileState of the items and use a data property to control it.

Please examine the solution and let me know if it helps.

Greetings,
Tina Stancheva
the Telerik team

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

0
L
Top achievements
Rank 1
answered on 23 Nov 2011, 06:34 PM
Thanks. However i cant add a TileViewItemState property to my object, I tried to use PreviewTileStateChanged event to find my new abject and make it's TileViewItemState is Maximized, but  there is a problem, when the TileViewItem Maximized, the old Maximized seems still on the background, for example, now there are 3 TileViewItems in a TileView, when I add a new one, there are still 3  TileViewItems in a TileView and an empty area on the MinimizedItemsPosition, do you have a better solution?





0
L
Top achievements
Rank 1
answered on 23 Nov 2011, 06:40 PM
BTW, I have another question, when i bind my objects to a tileview's itemsource, how I make the first one or last one's tileViewItemState Maximized? Thanks!
0
Petar Mladenov
Telerik team
answered on 28 Nov 2011, 04:44 PM
Hello L,

 Why are you unable to introduce TileState property in your business object ? Have you considered making a ViewModel wrapper class that will wrap your object from the DB and introduce new properties to it? It is worthy, because binding the TileViewItemState is the preferred way to handle such scenarios in MVVM way.

Regards,
Petar Mladenov
the Telerik team

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

Tags
TileView
Asked by
L
Top achievements
Rank 1
Answers by
L
Top achievements
Rank 1
Tina Stancheva
Telerik team
Petar Mladenov
Telerik team
Share this question
or