Listview filter

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.

Hope all that makes sense.

blocks (8)

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 :wink:You can also use request focus method in the text box, See here:

2 Likes

Instant listview filter bar

Maybe this is helpful for you

If my answer is helpful for you so mark as a solution :smiling_face_with_three_hearts:

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.

Thanks again!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.