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] "T.Jackson" <tj@mymail.com> wrote in message news:e%23y0El66DHA.3420@TK2MSFTNGP11.phx.gbl... > 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 > >
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" <tj@mymail.com> wrote in message news:OOXRVL86DHA.2540@TK2MSFTNGP11.phx.gbl... > 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 > > "Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message > news:OvwBhA76DHA.2752@TK2MSFTNGP09.phx.gbl... >> Hi, >> >> Use the currency manager to set the position. >> >> Dim cm As CurrencyManager >> >> cm = CType(Me.BindingContext(DataGrid1.DataSource), CurrencyManager) >> >> cm.Position = 3 >> >> >> Ken >> ------------------------ >> "T.Jackson" <tj@mymail.com> wrote in message >> news:e%23y0El66DHA.3420@TK2MSFTNGP11.phx.gbl... >> > 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 >> > >> > >> >> > >
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
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] "Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message news:OvwBhA76DHA.2752@TK2MSFTNGP09.phx.gbl... > Hi, > > Use the currency manager to set the position. > > Dim cm As CurrencyManager > > cm = CType(Me.BindingContext(DataGrid1.DataSource), CurrencyManager) > > cm.Position = 3 > > > Ken > ------------------------ > "T.Jackson" <tj@mymail.com> wrote in message > news:e%23y0El66DHA.3420@TK2MSFTNGP11.phx.gbl... > > 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 > > > > > >
thanx Ken, TJ [quoted text, click to view] "Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message news:OvwBhA76DHA.2752@TK2MSFTNGP09.phx.gbl... > Hi, > > Use the currency manager to set the position. > > Dim cm As CurrencyManager > > cm = CType(Me.BindingContext(DataGrid1.DataSource), CurrencyManager) > > cm.Position = 3 > > > Ken > ------------------------ > "T.Jackson" <tj@mymail.com> wrote in message > news:e%23y0El66DHA.3420@TK2MSFTNGP11.phx.gbl... > > 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 > > > > > >
Don't see what you're looking for? Try a search.
|