davidegironi / advanceddatagridview

A .NET WinForms DataGridView with advanced capabilities
392 stars 123 forks source link

Added filter checklist delay to improve performance #76

Closed rickardstolt closed 2 years ago

rickardstolt commented 2 years ago

Hi! Experienced some performance issues when using the checklist filter on ADGVs with a large number of rows (10 000+) and complex (per row unique) string values in the column. Making 1 search took some second which is no problem. But for every character added to the checklist filter textbox a new search was performed, adding up to an unacceptable time.

Fixed the issue by adding a delay to allow for multiple characters to be typed before the search is performed. For every change of the filter (characters added or removed) the delay is reset. Default delay is 600ms, but is adjustable.

Sharing it here to be used it if you like it.

davidegironi commented 2 years ago

Hello @rickardstolt , thank you for this mod. As soon as I'll have some spare time I'll check it and merge this. regards, Davide

davidegironi commented 2 years ago

Hello, I've take a look at your mod, although it's interesting I've implemented this in a slightly different way. Methods SetFilterChecklistTextFilterTextChangedDelayNodes and SetFilterChecklistTextFilterTextChangedDelayDisabled has been added to AdvancedDataGridview.cs Those set the number of nodes a filter should have to enable the textchange delay, this way the delay is enabled only if a lot of nodes exists. The second method force the disable of the textchanged delay. Can you kindly take a look to the example here and let me know? Thanks! advanceddatagridview-master.zip

rickardstolt commented 2 years ago

Hello, looks good. The only thing I'm missing is the ability to set the delay to an other value than the default. 300ms delay seems a bit to short. At least for my users... But its of course a balance of responsiveness to choose the right delay. A method SetFilterChecklistTextFilterTextChangedDelayMs would have been nice.

davidegironi commented 2 years ago

Mod added, thank you for your help.