PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
ADO.NET 2.0 - Get the value current record using the DataGridView
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
ADO.NET 2.0 - Get the value current record using the DataGridView
![]() |
ADO.NET 2.0 - Get the value current record using the DataGridView |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
I have a Contacts DataGridView that is bound to the TblContactsBindingSource. The Grid contains a list of contacts including the contacts name (Column 2 or "ContactName") I would like to get the value of the current "ContactName". What is the easiest way to do this? Thanks in Advance Phil |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Phil,
In this kind of questions is forever important in which event. In fact is everywhere the currencymanager the most easiest class to handle your question, however that needs that you know more from binding than mostly is known by people using the designer. Cor |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi,
"Phil Williams" <Phillandsarah@hotmail.com> wrote in message news:eltqOq5KGHA.1568@TK2MSFTNGP10.phx.gbl... > Hello, > I have a Contacts DataGridView that is bound to the > TblContactsBindingSource. > > The Grid contains a list of contacts including the contacts name (Column 2 > or "ContactName") > I would like to get the value of the current "ContactName". > > What is the easiest way to do this? Dim contactName As String = CStr(DirectCast(TblContactsBindingSource.Current, DataRowView)("ContactName")) or Dim contactName As String = CStr(DataGridView.CurrentRow.Cells(1).Value) HTH, Greetings > > > Thanks in Advance > Phil > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Thanks, it is soo easy when you know how!
Thanks again, Phil "Bart Mermuys" <bmermuys.nospam@hotmail.com> wrote in message news:e0f1o09KGHA.3164@TK2MSFTNGP11.phx.gbl... > Hi, > > "Phil Williams" <Phillandsarah@hotmail.com> wrote in message > news:eltqOq5KGHA.1568@TK2MSFTNGP10.phx.gbl... >> Hello, >> I have a Contacts DataGridView that is bound to the >> TblContactsBindingSource. >> >> The Grid contains a list of contacts including the contacts name (Column >> 2 or "ContactName") >> I would like to get the value of the current "ContactName". >> >> What is the easiest way to do this? > > Dim contactName As String = > CStr(DirectCast(TblContactsBindingSource.Current, > DataRowView)("ContactName")) > > or > > Dim contactName As String = CStr(DataGridView.CurrentRow.Cells(1).Value) > > > HTH, > Greetings > >> >> >> Thanks in Advance >> Phil >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

