B
Beverley
Hi all,
I'm creating my first "real" Windows Forms application. I'm having some difficulty binding a DataView to my custom control. I can do it just fine if I bind directly to the DataTable, and it behaves as I want. (Multiple controls on the screen, each one bound to a different row in the database.) Essentially, I'm making a datagrid-like interface, but using textboxes, etc.
This code works (code simplified)
For iRow = 0 To 2
dlg = new DataLine.Generic
...
Dim cm As CurrencyManager = CType(dlg.BindingContext(TCE.db.TheDataset.Personnel), CurrencyManager)
cm.Position = iRow
Next
It works great -- each DataLine (my custom control) is bound to a different row in the Personnel table.
However, when I try to change it to use a dataview instead, which is pointing at the Personnel table, each data line comes out exactly the same -- they are all bound to the first row. The view is being filtered correctly, because when I check the number of rows in the DataView, it is the smaller number that I am expecting.
dv.Table = TCE.db.TheDataset.Personnel
dv.RowFilter = "SubTabID = 1"
For iRow = 0 To 2
dlg = new DataLine.Generic
...
Dim cm As CurrencyManager = CType(dlg.BindingContext(dv), CurrencyManager)
cm.Position = iRow
Next
Any ideas? Does the Currency Manager not support a Position when connected to a dataview??
Thanks,
Beverley
I'm creating my first "real" Windows Forms application. I'm having some difficulty binding a DataView to my custom control. I can do it just fine if I bind directly to the DataTable, and it behaves as I want. (Multiple controls on the screen, each one bound to a different row in the database.) Essentially, I'm making a datagrid-like interface, but using textboxes, etc.
This code works (code simplified)
For iRow = 0 To 2
dlg = new DataLine.Generic
...
Dim cm As CurrencyManager = CType(dlg.BindingContext(TCE.db.TheDataset.Personnel), CurrencyManager)
cm.Position = iRow
Next
It works great -- each DataLine (my custom control) is bound to a different row in the Personnel table.
However, when I try to change it to use a dataview instead, which is pointing at the Personnel table, each data line comes out exactly the same -- they are all bound to the first row. The view is being filtered correctly, because when I check the number of rows in the DataView, it is the smaller number that I am expecting.
dv.Table = TCE.db.TheDataset.Personnel
dv.RowFilter = "SubTabID = 1"
For iRow = 0 To 2
dlg = new DataLine.Generic
...
Dim cm As CurrencyManager = CType(dlg.BindingContext(dv), CurrencyManager)
cm.Position = iRow
Next
Any ideas? Does the Currency Manager not support a Position when connected to a dataview??
Thanks,
Beverley