Groups | Blog | Home
all groups > vb.net data > february 2004 >

vb.net data : Databinding & active row


Ken Tucker [MVP]
2/5/2004 1:20:16 AM
Hi,

Use the currency manager to set the position.

Dim cm As CurrencyManager

cm = CType(Me.BindingContext(DataGrid1.DataSource), CurrencyManager)

cm.Position = 3


Ken
------------------------
[quoted text, click to view]

Ken Tucker [MVP]
2/5/2004 7:07:10 AM
Hi,

Yes. If you had several controls bound to a dataset the
curencymanager would keep them in sync. Since you are on a different form it
considers the dataset to be a differnet datasource.

Ken
---------------
[quoted text, click to view]

T.Jackson
2/5/2004 11:23:47 AM
Hi guys,
I'm new to .net & i've got a problem with regards to datasets & data
binding.

Here goes,
I've got a data grid & the active row (position) is the 3 row.
Now, i take this data set, & pass it to a seperate form, where i want to be
able to edit the details of this row.
So, in the load event of this new form, i bind the necessary columns of the
table to the required controls.

Problem -
The data displayed is that of the first row!!!!!

is this a behaviour of .Net,
where when data is bound to a control, the data will always be displayed
from the very first Row,
in other words....
is the current row in the datagrid totally independant of the dataset
(source), & has no effect on this??

--
Besty Regards,
TJ

T.Jackson
2/5/2004 2:26:46 PM
What i would also like to know is the following,
1. Now in form one, i have set the position for the dataset.
2. Next i pass this data set as a parameter to another form.
3. in this new form i set bind this dataset to other controls.
4. The position of the data in this second form is NOT the same as that in
(1).

Question?
Is this a behaviour of .NET?

Thanx for the solution Ken.

Regards,
TJ

[quoted text, click to view]

T.Jackson
2/5/2004 2:32:41 PM
thanx Ken,

TJ

[quoted text, click to view]

AddThis Social Bookmark Button