I have a listview (lvGlobalStudentNames) with student names. In my blocks, I set the lvGlobalStudentNames.ShowFilterBar = true. Everything works except the filter input box does not receive focus. When I type in a part of a student’s name, nothing appears in the filter bar and the list does not filter. However, if I tap in the filter bar and give it focus, what I type appears and it filters the list.
After I have manually clicked in the filter bar once and leave the filter, when I come back and do another filter, it all works fine and I don’t have to click in the filter bar to give it focus. I can just start typing and the test appears in the filter bar. However, if I exit/close the app and go back in and do my first filter, the same problem happens and I have it click in the filter bar the first time for it to work properly.
As the filter bar in the list view isn’t a textbox, so it won’t be triggered with the show keyboard method, so you will need to create your custom one with a the inbuilt text box You can also use request focus method in the text box, See here:
Thank you very much! I knew I could use a textbox to do the search, but was hoping the built in filter bar would work and allow setting the focus to the filter bar. However, your example you provided game me a great solution for using a textbox and I didn’t have to create the code myself.