Restricting focus to specific dock window

2 posts, 0 answers
  1. Boris
    Boris avatar
    4 posts
    Member since:
    Apr 2018

    Posted 26 Jul 2018 Link to this post

    Hi,

    The scenario is following

    The system has 2 different windows (type floating.).

    Say user is doing something like editing in a first window.

    I want programatically to restrict user to the window he is currently working in, until he commits his work.

    I.e. prevent him to go to window #2 until he clicks save - so it should work as a modal dialog box while user in editing mode.

    I tried to hook up to ActiveWindowChanging event of RadDock class. 

    I wrote essentially 

    private void DockerContainer_ActiveWindowChanging(object sender, DockWindowCancelEventArgs e)
    {
                // some processng
               if (needTo capture)
               {
                    e.Cancel = true;
                }
    }

    But it doesn't work.

    Are there any way to do what i want to do?

    Please help,

    Boris Pitel

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3835 posts

    Posted 30 Jul 2018 Link to this post

    Hello, Boris,    

    When you cancel the RadDock.ActiveWindowChanging event, the FloatingWindow is actually not set as ActiveWindow. However, since the FloatingWindow is a derivative of RadForm, it is being activated before the ActiveWindowChanging is even fired. The suitable approach for handling such cases is to use the respective validating events of the controls you have on the FloatingWindow and thus ensure that the input data is valid. Thus, it won't be necessary to block the activated form until the user enters valid data.

    I hope this information helps. If you have any additional questions, please let me know.  
     
    Regards,
    Dess
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top