Ticket T373232
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

How to set focus to a ParametrizedAction (Full Text Search) in code

Defaulting focus to full text search on newly opened root list views

created 9 years ago

Hi DX Team,

I would like my Windows Forms application to default focus to the "Full Text Search" on root list views that have been newly opened from the navigation (I'm using tabbed MDI, so I want focus to be retained when "flipping back" to a tab).

Currently focus goes to either the first row or first field (depending on whether it is a ListView or ListViewAndDetailView).

I notice that there was an example E807 to do this, but I can't seem to access it any more. Any assistance would be appreciated.

Adam

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

Hello Adam,

It is difficult to implement this functionality in MDI mode in version 15.2. However, there is a solution for version 16.1.6 or newer. See an example here: How to set focus to Full Text Search Box by code? For older versions, please consider using the GridControl's Find Panel to accomplish your task. You can focus it as shown below:

C#
public class CustomizeActionControlController : ViewController<ListView> { protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); if (View.IsRoot) { GridListEditor gridListEditor = View.Editor as GridListEditor; if (gridListEditor != null) { gridListEditor.Grid.Paint += Grid_Paint; } } } void Grid_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { GridControl gridControl = (GridControl)sender; GridView gridView = (GridView)gridControl.MainView; if (!gridView.IsFindPanelVisible) { gridView.ShowFindPanel(); } gridView.ShowFindPanel(); gridControl.Paint -= Grid_Paint; } }
    Show previous comments (3)
    Anatol (DevExpress) 9 years ago

      I just wanted to let you know that I could not make the solution from the How to focus a BarEditItem of a merged RibbonControl after showing an MDI child ticket work in XAF. I will continue researching the issue.

      Anatol (DevExpress) 9 years ago

        I have found an issue in our code that does not allow implementing this functionality. Our developers will research it: An item from a merged BarLinkContainerExItem cannot be focused programmatically.

        Anatol (DevExpress) 9 years ago

          We have managed to support this functionality in version 16.1.6. Please see an example here: How to set focus to Full Text Search Box by code?

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.