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

RadTileView Unloaded Event

7 Answers 65 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 1
Madhu asked on 19 Jul 2011, 07:52 AM
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

7 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 19 Jul 2011, 01:25 PM
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!

0
Madhu
Top achievements
Rank 1
answered on 20 Jul 2011, 08:34 AM
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>
0
Madhu
Top achievements
Rank 1
answered on 20 Jul 2011, 09:19 AM
Also wanted to add that we want to handle each tileviewitem because some tileviewitems do not require this message to be displayed.
0
Zarko
Telerik team
answered on 22 Jul 2011, 03:21 PM
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!

0
Madhu
Top achievements
Rank 1
answered on 25 Jul 2011, 06:48 AM
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
0
Madhu
Top achievements
Rank 1
answered on 25 Jul 2011, 07:50 AM
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
0
Zarko
Telerik team
answered on 27 Jul 2011, 02:44 PM
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!

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