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.

GridFindReplaceDialogSink performance

Thread ID:

Created:

Updated:

Platform:

Replies:

8286 Oct 30,2003 12:11 PM Oct 30,2003 12:33 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 30, 2003 12:11 PM

I'm using the GridFindReplaceDialogSink class to find a specific row in my grids, and it works find most of the time. But I'm having a performance issue with grids with a large number or rows. If the current row is at the top of the grid and the row you are trying to find is at the bottem, it takes forever. I've been trying to find a way to find the row in the datasource with something like the datatable.rows.find() method and then manipulate the currecy manager to reflect the row in the grid, but no such luck.

Administrator [Syncfusion]
Replied On October 30, 2003 12:23 PM

Hi Scot, You need to implement your own IGridFindReplaceDialogSink. This allows you to customize to the exact behavior you need. In your case you will not want to let the grid loop through all cells of the grid. Instead you can take advantage knowledge you have about the underlying DataTable. If you search for values that are in the sort key of the DataView you can use the Find method. Another alternative would be to create a RowFilter and apply with something like dv.RowFilter = "City = 'Berlin'"; or in worst case you just loop through records in the underlying dataview and do a manual search there. Once you found the record you can then move the current cell with CurrentCell.MoveTo. The Find method should look something like this in your FindReplaceDialogSink: public bool Find(long key) { // Do Not loop through grid ... // Instead call DataView.Find of your underlying datasource // When find has found the correct record move the current cell to that record and return true } Stefan

Administrator [Syncfusion]
Replied On October 30, 2003 12:33 PM

Here is one technique that implements a find from scratch. In this sample, a GridDataBoundGrid with 20000 rows can return all occurrences of a string in less than 100 msecs on my system. It does so by copying the column to an arraylist, and using ArrayList.IndexOf to do the searching. Now th this simple implementation, this requires a full word match. But you can use a ListBox and ListBox.FindString to do 'startswith' 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.

;