Hello,
I had a question concerning WinGrid performance when it comes to looping through the entire grid to obtain the rows which have been modified. Right now I created an unbound column called ‘Edited’, which is simply a Boolean column that is currently used to indicate whether or not changes have occurred in a row.
Here is the code I have written so far to accomplish looping through the grid to obtain the rows that contain changes.
This code works perfectly, however I do run into a problem when I have 5000+ rows in my grid. The grid pauses for maybe 30 seconds or more, which seems to be an excessive amount of time for this operation to be performed to me. Is there possibly a faster way I can speed up the processing or is there another type of RowsCollection I can get from the UltraGrid like for instance RowsEditCollection? Is there a solution or workaround in the Knowledge Base perhaps? I was not succesful in finding though. Please advise.
Adrian
One of the things I've done in cases like this is to keep a Dictionary around and when the row (or row and cell if I care about that) is modified I add the row/cell to the dictionary if it is not already there..when the row is no longer dirty (however you figure that out) I remove it from the dictionary. That way I can track the rows that have been changed dynamically and don't have to loop over the grid rows. There may be other simple structures (List<T> or something) that might work for you if a Dictionary is to much.
Just a suggestion.