This is a migrated thread and some comments may be shown as answers.

UI Crash with Update itemsource which was a over 6000 columns will stop UI

2 Answers 32 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mengjie
Top achievements
Rank 1
Mengjie asked on 16 Jan 2016, 05:02 AM

If my itemsource already has a very large datatable source for example with 6000+ columns and one line then update it to a small table by changing the itemsource. 

private static void OnItemsSourcePropertyValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var dynamicGrid = d as DynamicGrid;
            if (dynamicGrid == null)
                return;
            try
            {
                dynamicGrid.ItemsSource.Dispose();
                dynamicGrid._grid.SelectedItems.Clear();
                dynamicGrid._grid.SelectedItem = null;
                dynamicGrid._grid.Rebind();
                dynamicGrid.ItemsSource = null; stop here and no exception,code stop running
                dynamicGrid.ItemsSource = e.NewValue as DataTable;   
            }

}

 

2 Answers, 1 is accepted

Sort by
0
Mengjie
Top achievements
Rank 1
answered on 16 Jan 2016, 05:07 AM
public DataTable ItemsSource
        {
            get { return (DataTable)GetValue(ItemsSourceProperty); }
            set
            {
                SetValue(ItemsSourceProperty, value);

                _radDataPager.Source = value != null ? value.DefaultView : null;
            }
        }
0
Petya
Telerik team
answered on 20 Jan 2016, 03:54 PM
Hi Mengjie,

I'm not aware of the specific implementation at your end, but it looks like you're setting the ItemsSource property in the change callback for the ItemsSource property. My guess is this is causing an infinite cycle and that's why you're observing the crash. Could you try moving the code to see if that resolve the issue?

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Mengjie
Top achievements
Rank 1
Answers by
Mengjie
Top achievements
Rank 1
Petya
Telerik team
Share this question
or