I have a WPF application that has a MyDataGrid. It has a handler for the MyDataGrid_Loaded event. In this handler, I do some actions, such as MyDataGrid.Items.Refresh() . To reduce the delay in loading the datagrid, I declared a delegate and update the datagrid in it, and I pass it to MyDataGrid by the link:
public partial class MainWindow { public delegate void DataGridUpdateDelegate(ref DataGrid datagrid); public static void DataGridUpdate(ref DataGrid datagrid) { datagrid.Items.Refresh(); } private void MyDataGrid_Loaded(object sender, RoutedEventArgs e) { ... DataGridUpdateDelegate _tmpDelegate = DataGridUpdate; _tmpDelegate.BeginInvoke(ref MyDataGrid, nul, null); } } But MyDataGrid not updated, although the delegate fulfills.
What is wrong here?
MyDataGridshould we guess ourselves? - VladD