Home - Forums-.NET - FlyGrid.Net (Windows Forms) - CurrencyManager

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

CurrencyManager
Link Posted: 14-Aug-2007 01:46
I have bound a grid to a DataSet with one DataTable with the command .Rows.SetDataBinding(MyDataSet, \"MyTable\").

I would expect that the grid interacts with the form's databinding. This means that I should be able to access the currency manager position with:
Me.MyForm.BindingContext(MyDataSet, \"MyTable\").Position

This does not work for me. I suspect it does not work at all, and that the grid keeps it's own currency.
I now made a quick workaround:
in the NodeSelectedChange event handler, I set the position of the currency manager to the grid's .Selected.Index.

Is there a better way?

What I want to achieve, is that when I select a certain row, that the other controls on the form get updated. Normally, this kind of thing is taken care of by the currency manager automatically.
Link Posted: 14-Aug-2007 12:26
As far as I understand your idea, the actual reason is that
Me.MyForm.BindingContext(MyDataSet, \"MyTable\") returns not what you're expecting it to return.

The grid control (like other grids including standard DataGridView) may have different contexts from distinct DataViews (e.g. when sorting or etc.).

So if you need to get DataRow associated with a node, then you should  use the Node.Value property.

So you need to use the same DataView in Rows.SetDataBinding(..) and your controls in order to achieve what you need.