Get a value from a DetailsView Control

  • Thread starter evandelagrammaticas
  • Start date
E

evandelagrammaticas

Hi all,

I have been searching for this one for a while now.

I have a databound details view control which links to a table that
has firstName, MiddleName and Surname, I would like to reference a
field value witin that control...

I would like to check the value of the surname field and assign it to
a label control, but am unable to find the code to do this.

Something like this... label1.text = detailsview.formcontrol.value

I have found plenty of references and long-winded explanations, but
nothing that is too the point and uses the VB structure as opposed to
the C#

Any help would be GREATLY appreciated.

Regards

Evan
 
S

simon bowes

This is driving me mad!

I am having exactly the same difficulties.

I can only conclude that you and I are trying to do something out of the ordinary. There doesnt seem to be anything out there which explains how to refer to the value of a child control of a DetailsView.

If you found a solution or found somewhere where they can help, please let me know.

Simon.



evandelagrammatica wrote:

Get a value from a DetailsView Control
24-Dec-08

Hi all,

I have been searching for this one for a while now.

I have a databound details view control which links to a table that
has firstName, MiddleName and Surname, I would like to reference a
field value witin that control...

I would like to check the value of the surname field and assign it to
a label control, but am unable to find the code to do this.

Something like this... label1.text = detailsview.formcontrol.value

I have found plenty of references and long-winded explanations, but
nothing that is too the point and uses the VB structure as opposed to
the C#

Any help would be GREATLY appreciated.

Regards

Evan

Previous Posts In This Thread:

Get a value from a DetailsView Control
Hi all,

I have been searching for this one for a while now.

I have a databound details view control which links to a table that
has firstName, MiddleName and Surname, I would like to reference a
field value witin that control...

I would like to check the value of the surname field and assign it to
a label control, but am unable to find the code to do this.

Something like this... label1.text = detailsview.formcontrol.value

I have found plenty of references and long-winded explanations, but
nothing that is too the point and uses the VB structure as opposed to
the C#

Any help would be GREATLY appreciated.

Regards

Evan


Submitted via EggHeadCafe - Software Developer Portal of Choice
Adding WCF Service References
http://www.eggheadcafe.com/tutorial...9-dfa51a9fab8e/adding-wcf-service-refere.aspx
 
A

Andy O'Neill

This is driving me mad!

I am having exactly the same difficulties.

I can only conclude that you and I are trying to do something out of the
ordinary. There doesnt seem to be anything out there which explains how to
refer to the value of a child control of a DetailsView.

If you found a solution or found somewhere where they can help, please let
me know.

Simon.
I'm out of practice with vb

You use findcontrol on the container to find a child and get a reference to
it.
If you google findcontrol you can maybe get more reliable code.

Very rusty with vb but something like

dim tb as textbox
dim s as string
tb = detailsview1.findcontrol("mytextbox")
s = tb.text

Actually, if you look at the source for your screen you will see that the
name of the control is predictable anyhow.
I think you can specify it with vs2010.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top