FRoeCassNet
Programmer
I have a DataGrid that I am binding to a DataView. I setup a handler on the DataView's CurrentChanged event and everything works fine as long as I have the DataView's AllowNew property set to True. If I set it to False, then "sometimes" after reloading the data, the event doesn't get fired anymore. Has anyone seen anythink like this before?
Here's a sample of what I'm doing...
MyView.Table = MyDataSet
MyGrid.DataSource = MyView
--Form Load--
AddHandler Me.BindingContext(MyView).CurrentChanged, AddressOf MyView_CurrentChanged
MyDataset.Merge(<loaded data>)
--Button Click--
MyDataset.Clear()
MyDataset.Merge(<loaded data>)
--MyView_CurrentChanged--
Debug.WriteLine("Current changed"
In the Form Load, I set the handler for the view's currentchanged event and load the initial data into the dataset. As I click across rows in the datagrid, the "Current changed" message gets logged. I click a button and clears the dataset and loads in another block of data. I can click on another row and i will log the "Current changed" message, however, if I set they MyView.AllowNew property to False, then when I reload the data (from the button click) it won't trigger the Current changed event. If I click on the grid enough times, it will eventually fire the event and start tracking it again, then if I reload it, it will stop firing again, etc. Sometimes it will keep firing the event after reloads and sometimes it fails to fire it. If the AllowNew is True, then it never fails.
Any help would be appreciated,
Thanks in advance.
Here's a sample of what I'm doing...
MyView.Table = MyDataSet
MyGrid.DataSource = MyView
--Form Load--
AddHandler Me.BindingContext(MyView).CurrentChanged, AddressOf MyView_CurrentChanged
MyDataset.Merge(<loaded data>)
--Button Click--
MyDataset.Clear()
MyDataset.Merge(<loaded data>)
--MyView_CurrentChanged--
Debug.WriteLine("Current changed"
In the Form Load, I set the handler for the view's currentchanged event and load the initial data into the dataset. As I click across rows in the datagrid, the "Current changed" message gets logged. I click a button and clears the dataset and loads in another block of data. I can click on another row and i will log the "Current changed" message, however, if I set they MyView.AllowNew property to False, then when I reload the data (from the button click) it won't trigger the Current changed event. If I click on the grid enough times, it will eventually fire the event and start tracking it again, then if I reload it, it will stop firing again, etc. Sometimes it will keep firing the event after reloads and sometimes it fails to fire it. If the AllowNew is True, then it never fails.
Any help would be appreciated,
Thanks in advance.