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.
Unfortunately, activation email could not send to your email. Please try again.

implementing search when using paging in virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

18913 Sep 13,2004 11:29 AM Sep 13,2004 12:17 PM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 13, 2004 11:29 AM

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?

Administrator [Syncfusion]
Replied On September 13, 2004 11:37 AM

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.

Administrator [Syncfusion]
Replied On September 13, 2004 12:03 PM

>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.

Administrator [Syncfusion]
Replied On September 13, 2004 12:17 PM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;