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

Interrupting the "find" grid

Hi. I am using the gridcontrol to display a large amount of data. The user must be able to incrementally search through the data for text entered in the search textbox. The problem is that since there are so many rows, it is possible that the search may take a very long time and so the user must be able to abort the search... I am using the gridcontrol find function shipped with syncfusion. I have attempted to run the find in a seperate thread so that the search window remains responsive, but I guess a long search takes up too many cycles and the window containing the "abort" button is still totally unresponsive. Any ideas?

1 Reply

AD Administrator Syncfusion Team October 5, 2004 06:52 PM UTC

In this forum thread, there is a sample that shows an alternative method for searching the grid. The main reason that that the default implementation is slow is that it uses a method that triggers events (QueryCellInfo) to retrieve cell values. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=19862 If you directly use such a technique, then you will have control of the loop and could check if the process should be cancelled. Here is code similar to that used in the sample that avoid events. Using an indexer to retrieve grid[row, col].CellValue triggers events (like QueryCellInfo). You can avoid triggerring these events (which slow things down) by accessing the GridData directly.
GridStyleInfo style;
GridStyleInfoStore store = grid.Data[rowIndex, colIndex];
if (store != null)
	style = new GridStyleInfo(store);
else
	style = new GridStyleInfo();

object cellValue = style.CellValue;

Loader.
Live Chat Icon For mobile
Up arrow icon