We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

implementing search when using paging in virtual grid

Hi! You may remember me from such posts as "implementing paging using virtual grids"... I am now trying to implement an incremental search for that. The problem is that if I keep searching through each page at a time and keep loading pages as needed, I don''t really know where the end of the file/grid really is. I was wondering if there is a more efficient or an easier way of doing this?

3 Replies

AD Administrator Syncfusion Team September 13, 2004 03:37 PM UTC

Can you search your datasource directly, and not try to use the grid at all during this search? If you go through the grid, you will have to work through the grid''s virtual events, an dthis will slow things down if you are paging. If you can access your datasource directly to search it, you will avoid this overhead.


AD Administrator Syncfusion Team September 13, 2004 04:03 PM UTC

>Can you search your datasource directly, and not try to use the grid at all during this search? I have already considered that but I am using datatable of a fixed size (page size) which is repopulated as needed. This table does not contain any columns that are unique... this means I cannot set any primary keys, which is required for using the find method. Now, I could add another column every time and populate it with unique numbers each time for eg... but I am thinking that might be even bigger overhead in terms of complexity and performance? But maybe I am not thinking hard enough... > >If you go through the grid, you will have to work through the grid''s virtual events, an dthis will slow things down if you are paging. If you can access your datasource directly to search it, you will avoid this overhead. The requirement is that grid must scroll to appropriate row in grid at every key stroke in the search box (if the substring is found ofcourse)... so in any case I have to search through every page. This is the case for "Find Next" aswell.


AD Administrator Syncfusion Team September 13, 2004 04:17 PM UTC

You can pobably just quickly populate an arraylist (or event a listbox) and use it to search things. This is much faster that trying to do it through the grid. Here is a sample. It implements a fast FindAll. In this sample, a GridDataBoundGrid with 20000 rows can return all occurrences of a string in less than 100 msecs. It does so by copying the column to an arraylist, and using ArrayList.IndexOf to do the searching.

Loader.
Live Chat Icon For mobile
Up arrow icon