RadTileView Unloaded Event

8 posts, 0 answers
  1. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 19 Jul 2011 Link to this post

    Hi,

    We have a few text fields in the Tile View which the user enables for editing by clicking an Edit button, fills in data and clicks on a Save button to commit the changes. Before the user minimizes the tile, we would like to make sure that there are no unsaved changes by showing the user a warning message.

    We are using the Unloaded Event to trigger this check. However we see an issue where the the message sometimes pops up correctly before allowing tile to minimize, but sometimes it minimizes the tile and then shows the message.

    Please let us know how can we resolve this issue.

    Regards,
    Madhu
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 19 Jul 2011 Link to this post

    Hi Madhu,
    I'm a little bit confused because the Unloaded event should be fired on minimization, unless you're using the ui virtualization and the item is being virtualized when minimized? If you want your message box to open before you minimized an item you should handle the Preview Tile State Changed event and open it there.
    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!

  3. DevCraft banner
  4. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 20 Jul 2011 Link to this post

    Thanks Zarko,

    We would like to have this fired on a tileviewitem as we are having 12 tileviewitems inside the tileview and each of these tileviewitems can be minimized/maximized.

    The XAML structure is as below. I have stripped the code within. We would like to show the message on minimizing the RadTileViewItem. Could you please provide a sample for this?

    Thanks,
    Madhu


    <telerikNavigation:RadTileViewItem>
     
          <telerikNavigation:RadTileViewItem.Header>
           </telerikNavigation:RadTileViewItem.Header>
           <telerikNavigation:RadTileViewItem.Content>
                 <telerik:RadFluidContentControl>
                       <telerik:RadFluidContentControl.Content>
                       </telerik:RadFluidContentControl.Content>
                        <telerik:RadFluidContentControl.LargeContent>
                        </telerik:RadFluidContentControl.LargeContent>
                 </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem.Content>
     </telerikNavigation:RadTileViewItem>
  5. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 20 Jul 2011 Link to this post

    Also wanted to add that we want to handle each tileviewitem because some tileviewitems do not require this message to be displayed.
  6. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 22 Jul 2011 Link to this post

    Hello Madhu,
    The PreviewTileStateChanged event is fired for every item that changes its state and in the event handler you can check if you want to show the message for this item.
    Could you please explain us what behavior you don't like in the attached sample project ?

    Kind regards,
    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!

  7. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 25 Jul 2011 Link to this post

    Thanks Zarko.

    If I am correct, in the sample application, when I have Item 1 in Maximized position and now I click Item 2, the message will appear, which is fine. Can I also display this message when I click on the minimize button of Item 1? If so, please provide a sample for that.

    Thanks,
    Madhu
  8. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 25 Jul 2011 Link to this post

    To elaborate a bit more, in our project each radtileviewitem  in the radtileview  has a separate datacontext (viewmodel).

    I need to access the variables inside the Viewmodel of respective radtileviewitem  to determine whether the “Are you sure you want to minimize this item?”  has to be displayed or not for the respective radtileviewitem.

    Therefore I want to use “PreviewTileStateChanged”  event on radtileviewitem and not on radtileview.

    Request a demo where “PreviewTileStateChanged” is fired when user either minimizes a currently "being edited" radtileviewitem or maxmizes a radtileviewitem when another radtileviewitem is currently "being edited". Also confirmation if the PreviewTileStateChanged event  works for radtileviewitem or not
  9. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 27 Jul 2011 Link to this post

    Hi Madhu,
    In which cases you'll show the message depends only on the if statements inside the PreviewTileStateChanged event handler, so you can customize them as you want.
    The RadTileView PreviewTileStateChanged event wraps the PreviewTileStateChanged events of the RadTileViewItems, so basically they are the same. You can get the item from a container with the ItemContainerGenerator.ItemFromContainer method.
    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!

Back to Top
DevCraft banner