About Adding and deleting RadTileViewItem dynamically

6 posts, 0 answers
  1. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 04 Nov 2011 Link to this post

    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.


  2. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 07 Nov 2011 Link to this post

    I tried to use ItemContainerGenerator.ContainerFromItem(NewItem) to find the new TileviewItem, However it's null.

  3. DevCraft banner
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 09 Nov 2011 Link to this post

    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 >>

  5. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 23 Nov 2011 Link to this post

    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?





  6. L
    L avatar
    11 posts
    Member since:
    Nov 2011

    Posted 23 Nov 2011 Link to this post

    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!
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Nov 2011 Link to this post

    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 >>

Back to Top
DevCraft banner