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

Fluid Control button

2 Answers 59 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Hakki
Top achievements
Rank 1
Hakki asked on 12 Oct 2012, 11:48 AM
Hello,

I have a button in TileView and I am trying to make it so when it is clicked, certain grid gets hidden and another goes visible. But I can't seem to find a way to fire off the button handler. I think because it is in a style.

Can someone please clear my confusion and tell me a way to get the button working as intended please, thank you.

The project is here:  https://www.dropbox.com/s/uwuwpwhawpne37z/TileViewButtonInFluidControl.zip

When I click 'add patient', the description should collapse and be replaced by the submit patient grid.

Thanks a lot.

2 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 17 Oct 2012, 08:32 AM
Hi Hikki,
First I'd like to say that if you use ContentTemplate the other code that you've put in the content won't be applied. That's why nothing happens on "Add Patient" button click - in the event handler you're hiding/showing the grids from the content when you need the grids from the contentTemplate.
If you're going to define all your RadTileViewItems in XAML I think you don't need contentTemplate - you could just add everything in the content, but if you're going to use templates you'll have to change your code a little bit. The best approach will be to use command in your ViewModel and bind the visibility of your parts (the grid and the textblock) to some properties, but a possible workaround is to use the parentOfType and childrenOfType methods in an event handler to do the same in code-behind.
I've changed your project a little bit and attached it so could you please examine it and if you have further questions feel free to ask.

Kind regards,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hakki
Top achievements
Rank 1
answered on 17 Oct 2012, 11:42 AM
Hello Zarko,

Thanks for your informative reply. Commands and MVVM model in general is something I recently picked up and am using in any future SL projects. It was redeemed not worth the time to restructure the current project which is 2 years in and quite large now.

Anyway, all good and working now and thanks again,
Hakki
Tags
TileView
Asked by
Hakki
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Hakki
Top achievements
Rank 1
Share this question
or