Fluid Control button

3 posts, 1 answers
  1. Hakki
    Hakki avatar
    47 posts
    Member since:
    Sep 2012

    Posted 12 Oct 2012 Link to this post


    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. Answer
    Zarko avatar
    755 posts

    Posted 17 Oct 2012 Link to this post

    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Hakki
    Hakki avatar
    47 posts
    Member since:
    Sep 2012

    Posted 17 Oct 2012 Link to this post

    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,
Back to Top