Never mind. I figured out the problem
For the benefit of anyone in the group experiencing similar problems, it
seems the CurrencyManager cannot handle rows where a control is bound to a
Null valued column. I had missed initializing the value of a boolean field
to False and the DBNull value was apparently causing the problem....all works
fine now.
"DaveVB" wrote:
> I am trying to manage databound controls on a form with a TreeView as the
> RecordSelection Source. As long as I am navigating among rows that existed
> when the form was openned, I can set the CurrencyManager position using the
> following line of code:
>
> Me.BindingContext(dataView).Position = dataView.Find(treeview.node.tag.id)
> The treeview.node.tag is a strongly typed DataRow from the underlying table
> of the dataView.
>
> However, when I add a row to the table, either directly or through the
> dataView I am unable to set the Position property...After executing the line
> of code above, the Position/Current row remains unchanged.
>
> If I use the CurrencyManager.AddNew method instead, the current row seems
> to change to the newly inserted row automatically, but subsequent calls to
> the line of code above to move to other rows do not work properly. It is as
> if the CurrencyManager is out of sync with the underlying table.
>
> Can anyone help with what is happening here and how to avoid this problem?
> Any help will be greatly appreciated.
>
|