Visibility question

8 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 23 May 2012 Link to this post


    I have a RadRibbonView with his "IsMinimized" property set to "True". In my RadRibbonView, I have a "Search" RadRibbonTab with many fields and a search button. If my users click on the RadRibbonTab, the RadRibbonTab expand and the user can enter values the fields and click on the search button to start searching informations.

    I'm trying to implement a CTRL+F gesture (search shortcut) and I would like to know how I can force the RadRibbonTab to be visible by code to simulate a user click on the RadRibbonTab.

    Thank's
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 25 May 2012 Link to this post

    Hello Oliver,

    You can use the following code in your handler for the CTRL+F gesture:
    var popup = ribbon.ChildrenOfType<Popup>().LastOrDefault();
    if (popup != null)
    {
       popup.IsOpen = true;
    }
    If you need further help feel free to ask.

    All the best,
    Viktor Tsvetkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 25 May 2012 Link to this post

    Hi Viktor,

    as I'm on DotNet 3.5 I had to modify your code a little bit because of the LastOrdDefault function but I still having a problem. I have to expand and collapse at least one time manually my RadRibbonTab to have my gesture working correctly. If I not doing this, the RadRibbionTab never show up. If I put a breakpoint in my code, in both situation, my application stop ont it.

    Thank's

      private void gestureSearch_Trigger(object sender, ExecutedRoutedEventArgs e)
      {   
       IEnumerable<Popup> allPopups = radRibbonBar.ChildrenOfType<Popup>();

       if (allPopups != null)
       {
        Popup thePopup = null;

        foreach(Popup onePopup in allPopups)
        {
         thePopup = onePopup;
        }

        if (thePopup != null)
        {
         thePopup.IsOpen = true;
         ribtabSearch.Focus();
         wtbSearchNCE.Focus();
        }
       }
      }

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 May 2012 Link to this post

    Hello Oliver,

    I attached a sample solution demonstrating how to get over this issue. Basically it's best to select the search tab instead of focusing it. Also, you'll need to focus the input control a bit later in order to make sure it will be property focused, so you'll have to use a dispatcher.

    Please have a look at the project and let me know if it helps.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 29 May 2012 Link to this post

    Hi,

    this code should work on .Net 3.5???

    Thank's
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 May 2012 Link to this post

    Hello Oliver,

    The application I sent over is targeting WPF 3.5. Doesn't it work on your side? Please let me know if I'm missing something.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 29 May 2012 Link to this post

    Hi,

    LastOrDefault method was not recognized!!!

    Thank's
  9. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 31 May 2012 Link to this post

    Hello Oliver,

    I'm sorry, I should've used your approach instead. I modified my sample to not use the LastOrDefault method. Please let me know if the sample works for you now.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready