Hello
The Wingrid in my application is populated on runtime from the database. I need to implement a search functionality in all the grids. Is there any built in functionality associated with the control? Or please share your thoughts on making the search of an item possible in Wingrid.
Thanks in Advance
jeni
Hi Jeni,
There's no built-in search functionality in the grid. Searching varies so much by application that it's pretty tough to come up with a generic way to implement it. And the grid doesn't have any way to search that is more efficient than what you could implement yoursef - looping through the rows.
The grid has filtering, of course. So using the FilterRow might be a good option for you.
If you want to search, though, how you do it depends any number of factors like:
Are you searching hierarchical data or just flat data?
Which column(s) do you want to search?
What is your search criteria?
Do you want to search by Value or by Text?
There's a KB article which demonstrates how to do a simple keyboard search on a flat grid that might point you in the right direction: HOWTO:How can I make UltraWinGrid allow keyboard searching?
If that's not what you are looking for, then maybe you could reply with answers to some of the questions above and I could whip up some sample code for you.
Hello Mike
Thanks for your reply.
Is there any possibility of adding text in a search textbox, and finding the occurrence of that item in all the columns in the ultragrid.?
I am working on many ultragrids in different tabs in the same form. I need to search on flat data.
My plan is to to allow a search textbox for each grid, so that the text in it is searched on the associated grid.
Any workaround for achieving this?
Thanks in advance.
Jeni