Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
performance issues
posted

Hi,

I derived my SelectAllComboEditor from your XamComboEditor to provide a "SelectAll" button in a ContextMenu to my users.

Unfortunately, the operation takes about 20 sec for 100 entries and about 3 min for 1000 entries.

How can I speed this up?

using System.Windows.Controls;
using System.Windows.Input;
using Infragistics.Controls.Editors;
using Microsoft.Practices.ObjectBuilder2;
using Workbench.Core.UI.Commands;

public class SelectAllComboEditor : XamComboEditor
{
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
{
ContextMenu contextMenu = new ContextMenu();

MenuItem selectAll = new MenuItem
{
Header = "Select All",
Command = SelectAllCommand
};

contextMenu.Items.Add(selectAll);
contextMenu.Items.Add(deselectAll);

contextMenu.IsOpen = true;
}

public ICommand SelectAllCommand
{
get
{
return new RelayCommand((_) =>
{
SelectAll();
});
}
}

private void SelectAll()
{

//slow operation
Items.ForEach(x => x.IsSelected = true);
}

}

<utils:SelectAllComboEditor Grid.Column="4"
Grid.Row="1"
Margin="0,0,10,0"
AllowMultipleSelection="True"
CheckBoxVisibility="Visible"
ItemsSource="{Binding Path=ErrorParameters}"
DisplayMemberPath="Name"
IsSelectedMemberPath="IsSelected"
IsEditable="False"/>

Best

Oliver

Parents
  • 34810
    Offline posted

    Hello Oliver,

    Thank you for your post!

    I have been investigating this issue, and I have been able to reproduce it. While it isn't exactly taking 3 minutes to select 1000 items (more like 1 on my machine), the performance is still rather slow. After profiling the application I used to test this, this appears to be coming from the XamComboEditor.SelectedItems.CollectionChanged event being fired for each and every item as it gets selected. I am unsure of a workaround to this, apart from implementing a custom selected items collection.

    This behavior is rather unexpected, and so I have asked our engineering staff to take a look at it. To ensure this issue receives attention, I have logged it in our internal tracking system with a development ID of 203114. I have also created a case for you on this matter. It has an ID of CAS-158531-M7C0T1 and you can access it at https://es.infragistics.com/my-account/support-activity. This case will have development issue 203114 linked to it so that you can receive updates about this issue as they become available.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Reply Children
No Data