HI Guys,
a customer want to set the focus into the FullTextSearch Action if a root listview is opened. I alread read Q141866 and tried it with an controller, similar to Q141866 and call PerformClick() - but it simply does nothing. I use TabbedMDI with Ribbon - are there some specifics to this UI?
We have closed this ticket because another page addresses its subject:
How to set focus to a ParametrizedAction (Full Text Search) in code
Hi Noxe,
Thanks for contacting us.
I am also having difficulty with focusing the editor corresponding to this Action. I tried the following code, which did not work for me:
public class Q269044 : ViewController<DevExpress.ExpressApp.ListView> { public Q269044() { TargetViewNesting = Nesting.Root; } protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); Control ctrl = View.Control as Control; if (ctrl.IsHandleCreated) FocusFilter(); else ctrl.HandleCreated += (sender, e) => FocusFilter(); } private void FocusFilter() { XtraFormTemplateBase template = (XtraFormTemplateBase)Frame.Template; BarManager manager = template.BarManager; manager.Items["Filter by Text"].PerformClick(); //manager.Bars["Main Toolbar"].ItemLinks[12].Focus(); //if (manager.ActiveEditor != null) // manager.ActiveEditor.Focus(); } }
We need some additional time to suggest how to better approach this. Please bear with us.
Thanks,
Dennis
Hi Noxe,
Thanks for your patience. Please refer to the How to focus a search box corresponding to the FullTextFilterAction, once a root ListView is opened in a Windows Forms application example in the Code Central.
Thanks,
Dennis
Hi Dennis,
thank you for the example - is there any reason why you have implemented this in the program.cs and not in an controller?
You're always welcome. No reason, actually.
Thanks,
Dennis
Hi dennis,
see my first post - "I use TabbedMDI with Ribbon" - in exactly that environment your example does not work? In all other it does, but with tabbed mdi focus is not set to the fulltextsearch?
Hi Noxe,
Thanks for the feedback and sorry for the inconvenience. We're working on your issue and will answer ASAP. Please bear with us.
Thanks,
Dennis
Hi Dennis,
i have seen that this post was several times updated last week - do you have any news on this?
Hi Noxe,
Thanks for the feedback. I will try to post an updated example tomorrow. Thanks for your patience.
Thanks,
Dennis
Hi Noxe,
I am finishing a sample for you and I would ask you whether your client wants to focus the filter editor each time the ListView is shown to him or only for the first time when he or she clicks a corresponding item in the navigation control?
Thanks,
Dennis
hi dennis,
thanks for the update - currently i have the requirement to set the focus to the filter editor each time a root listview is shown. i guess you mean that if an tab is already opened, and the user clicks only the tab header? so not sure what exactly you refering - but i think the goal would be to set the focus if the navigation item is clicked/executed(via shortcut)
thx again!
Hi Dennis,
i read that you go on vacation tomorrow for two weeks - will someone other finish the example?
btw: i wish you a nice holiday ;)
Hello Noxe,
>> will someone other finish the example?
Sure. Attached is a sample working for your particular case (TabbedMDI+Ribbon). I will update the E807 example with a more generic solution when I am back.
>>btw: i wish you a nice holiday ;)
Thank you!
Thanks,
Dennis
wow - quite complex for "only" set a focus - thanks for your help dennis - would not get this working without you!
Hi Martin,
I hope it's OK to close this ticket for now. Please let us know if you need any further assistance here.
Thanks,
Alex
Hi Dennis,
"I will update the E807 example with a more generic solution when I am back." -> is it possible to update the example if you find some time(outside some other discussions ;) )
Hello Noxe,
Yes, it is possible, but it will require some time. Please track this suggestion: Support - Update the E807 example with a more generic solution or the example itself.
Thanks,
Dennis
thx!