This question is locked. New answers and comments are not allowed.
Hi,
I am loading a huge amount of data in the GridView. The objects that I load to the Grid are dynamically generated using reflection.
Normally, I call ItemsSource when I am done creating all the objects (record items) from the data. This takes very long time as it has to wait till all the objects are created. What I would like to do is asynchronously add to the ItemsSource as the objects are created. How can I achieve this?
Code snippet:
var listType = typeof(List<>).MakeGenericType(new[] { generetedType });
var listOfCustom = Activator.CreateInstance(listType);
for()........
{
object generetedObject = Activator.CreateInstance(generetedType);
// Add Values to generetedType
........
listType.GetMethod("Add").Invoke(listOfCustom, new[] { generetedObject });
}
myRadGrid.ItemsSource = listOfCustom as IEnumerable; // About 1-2 minutes spent by now.
How can I update the ItemsSource within the loop?
Thanks,
Jitin
I am loading a huge amount of data in the GridView. The objects that I load to the Grid are dynamically generated using reflection.
Normally, I call ItemsSource when I am done creating all the objects (record items) from the data. This takes very long time as it has to wait till all the objects are created. What I would like to do is asynchronously add to the ItemsSource as the objects are created. How can I achieve this?
Code snippet:
var listType = typeof(List<>).MakeGenericType(new[] { generetedType });
var listOfCustom = Activator.CreateInstance(listType);
for()........
{
object generetedObject = Activator.CreateInstance(generetedType);
// Add Values to generetedType
........
listType.GetMethod("Add").Invoke(listOfCustom, new[] { generetedObject });
}
myRadGrid.ItemsSource = listOfCustom as IEnumerable; // About 1-2 minutes spent by now.
How can I update the ItemsSource within the loop?
Thanks,
Jitin