Home Forums WPF controls Xceed DataGrid for WPF Slow filtering but maybe not fault of datagrid…

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22559 |

    I am trying to filter my information in the datagrid, as per instructions in the documentation.

    However, after filtering about 6 times, it starts to take a long time. Like, after doing a few different filters on the same table. I only have 5 rows and 7 columns in my grid at the moment, so I don’t think it is excessive data, but after only a few filters it starts taking several seconds, and then more seconds and more and more…..

    Maybe I am using the filtering thing wrong, as I don’t know anything about it. It isn’t actually stopping on the code directly referencing the xceed datagrid, but I figure someone will know the answer.

    Here’s my code for this section:

    view = new BindingListCollectionView(tempptrwindow.fullWizardDataSet.Tables[0].DefaultView);
    view.CustomFilter = filterFromListboxes; //my filtering string
    //Console.WriteLine(“hi!”);
    datagridAllWizards.ItemsSource = view;

    Pretty straight forward, if I step through the code, or if I uncomment the console line, it stops on view.CustomFilter = filter…; and waits there.

    I guess I am not using this correctly, but I wouldn’t know how. If someone could help it would be great.
    Ask for more information if necessary, I don’t know what you need. Any suggestions appreciated.

    Imported from legacy forums. Posted by Marie (had 3571 views)

    Xceed Support
    Member
    Post count: 5658

    Hi, I tested using a setup where I have a DataView, wrapped inside a BindingListCollectionView() as for your case, but could not reproduce the “lag” you obtain.

    Just to know, are you re-affecting the ItemsSource each time you filter? if so, you don’t need to change the ItemsSource, only change the CustomFilter and the DataGridControl will refresh accordingly…

    If its not the case, then maybe the nature of the CustomFilter can explain the lag… can you share your row filter?

    Also, I would like to know the exact version of the DataGridControl you are using… A new version of the package is available (recent update), if you want to try with the new version, you can find it here:

    http://download3.xceedsoft.com/Packages/3.0.7170.16360/XceedComponentsWebInstall.exe

    The main download package will be updated soon with this version.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 351 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi, I tried to get the new version, it says it is version 1.0.7170.16090 which is only a bit like the number you give there.
    I also stopped updating the ItemSource each time too, but it is also still happening, and now it only updates the datagrid the first time I apply a filter. Perhaps I need to keep the same view to use again?

    But thanks for that advice, I was really hoping it would work…

    Here is some more information, although not much new.

    Setting up:
    BindingListCollectionView view = new BindingListCollectionView(tempptrwindow.myWizardDataSet.Tables[0].DefaultView);
    view = new BindingListCollectionView(tempptrwindow.fullWizardDataSet.Tables[0].DefaultView);
    datagridAllWizards.ItemsSource = view;

    Changing filter:
    BindingListCollectionView view = new BindingListCollectionView(tempptrwindow.fullWizardDataSet.Tables[0].DefaultView);
    view.CustomFilter = filterFromListboxes;

    Filter:
    I alternated between
    (Player = ‘Piri Weepu’)
    (Player = ‘Dan Carter’)

    Where Player is a column name in the datagrid and the dataset and the two strings both appear in the Player column multiple times, twice and thrice respectively.

    the datagrid (datagridAllWizards) and the dataset (fullWizardDataSet) don’t appear to have anything else done to them anywhere in the code.

    Imported from legacy forums. Posted by Marie (had 306 views)

    User (Old forums)
    Member
    Post count: 23064

    Also, I am using Vista (but I swear, it isn’t my choice 🙁 It drives me crazy).

    Imported from legacy forums. Posted by Marie (had 358 views)

    User (Old forums)
    Member
    Post count: 23064

    solved, sort of. I still don’t know why it was slow, but I changed to using just a DataView rather than a BindingListCollectionView, and left everything else the same, and it works fine.

    Imported from legacy forums. Posted by Marie (had 4814 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.