Hi There Thanks for Everyones Help So Far,

I used the Database Form Wizard and i`ve looked at he code from that. Its
working Great Now. Now the Only Problem I have is i`ve added a Datagrid to
my App Aswell, Makes it easier then clicking next a few hundred times to get
to the record I want. Ok I could just use a datagrid but it looks a lot
nicer if the Datagrid is there aswell. I`ve marked my Datagrid as Read only
and want the user to be able to click on the row they want and for that.
When I click on my Row on my datagrid is dosn`t update my Position_Changed
thinggy which tells them what record number there one.

Here is my Position Changed Code:

Private Sub dsSystemUsers_PositionChanged()
Me.lblNavLocation.Text = (((Me.BindingContext(dsSystemUsers,
"Passwords").Position + 1).ToString + " of ") +
Me.BindingContext(dsSystemUsers, "Passwords").Count.ToString)
End Sub

I take it I need to Add a Line for My Datagrid I just can`t find any info.
Anywhere on how to do it:( Anybody point me in the right Direction please?

Many Thanks
NSC

Re: Newbie - Datagrid Binding Problem by Bart

Bart
Fri Oct 28 03:35:53 CDT 2005

Hi,

"Wizard" <test@test.com> wrote in message
news:eJ3aeg52FHA.2196@tk2msftngp13.phx.gbl...
> Hi There Thanks for Everyones Help So Far,
>
> I used the Database Form Wizard and i`ve looked at he code from that. Its
> working Great Now. Now the Only Problem I have is i`ve added a Datagrid to
> my App Aswell, Makes it easier then clicking next a few hundred times to
> get to the record I want. Ok I could just use a datagrid but it looks a
> lot nicer if the Datagrid is there aswell. I`ve marked my Datagrid as Read
> only and want the user to be able to click on the row they want and for
> that. When I click on my Row on my datagrid is dosn`t update my
> Position_Changed thinggy which tells them what record number there one.
>
> Here is my Position Changed Code:
>
> Private Sub dsSystemUsers_PositionChanged()
> Me.lblNavLocation.Text = (((Me.BindingContext(dsSystemUsers,
> "Passwords").Position + 1).ToString + " of ") +
> Me.BindingContext(dsSystemUsers, "Passwords").Count.ToString)
> End Sub
>
> I take it I need to Add a Line for My Datagrid I just can`t find any info.
> Anywhere on how to do it:( Anybody point me in the right Direction please?

I assume that you have both controls (created by the wizard) and a DataGrid
(created by you), if the above code was from the wizard and you want the
grid and the controls to navigate together then set:
DataGrid1.DataSource to dsSystemUsers
DataGrid1.DataMember to "Passwords"

HTH,
Greetings

>
> Many Thanks
> NSC
>



Re: Newbie - Datagrid Binding Problem by Cor

Cor
Fri Oct 28 03:42:05 CDT 2005

Wizard,

I would try to use the currencymanager, that is in my opinion if you start
using you more simple and consequent than the datarowchange event.

A simple sample.

http://www.vb-tips.com/default.aspx?ID=3e6c910e-3c58-4ce7-a626-9cc458453630

I hope this helps,

Cor



Re: Newbie - Datagrid Binding Problem by No_So_Clever

No_So_Clever
Fri Oct 28 09:44:12 CDT 2005

Hi,

Thnks for you help. I now have this code:

dgdSystemUsers.DataSource = dvSystemUsers
dgdSystemUsers.DataBindings.Add("Datasource", dvSystemUsers, "DepartmentID")
cmSystemUsers = DirectCast(BindingContext(dvSystemUsers), CurrencyManager)

and then my Postition_Changed Code:

Private Sub dsSystemUsers_PositionChanged()
Me.lblNavLocation.Text = (((cmSystemUsers.Position + 1).ToString + " of
") + cmSystemUsers.Count.ToString)
End Sub

I know there is something wong with this line:

dgdSystemUsers.DataBindings.Add("Datasource", dvSystemUsers,
"DepartmentID") - but I just don`t know what.

Also what else will I need to Add into my Position Changed code to get my
lblNavLocation.Text to update when i click on my datagrid?

Many Thanks in Advance
NSC

"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:%23d53du52FHA.472@TK2MSFTNGP15.phx.gbl...
> Wizard,
>
> I would try to use the currencymanager, that is in my opinion if you start
> using you more simple and consequent than the datarowchange event.
>
> A simple sample.
>
> http://www.vb-tips.com/default.aspx?ID=3e6c910e-3c58-4ce7-a626-9cc458453630
>
> I hope this helps,
>
> Cor
>