techpr0
asked on
How do I pull a value from a DetailsView
ASP.NET 2.0/VB.NET 2.0 and sql server 05: How do I pull a value from a DetailsView?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is it possible to, when filling my form with these DetailsView on it, use this DetailsView Template field to hold the value retreived from the database? Or should I just hide the DetailsView and use a textbox?
Sorry, in order to get the Text Property you need to convert it to TextBox:
((Textbox)DetailsView1.Fin dControl(" ControlNam e")).Text
((Textbox)DetailsView1.Fin
Obviously change "Textbox" to the relevant Control
If you are going to use a Details View, use it to its full potential and use the TemplateField, if the DetailsView is generally unnecessary use a textbox. But if you have to hide a details view, i would suggest you dont hide it and use the templatefield
If you are going to use a Details View, use it to its full potential and use the TemplateField, if the DetailsView is generally unnecessary use a textbox. But if you have to hide a details view, i would suggest you dont hide it and use the templatefield
ASKER
Good, I'm on the right track. I am using a template field but how do I assign something to the template field without binding it to a datasource?
Im not entirely sure what you mean, but to be honest my knowledge on this is limited, i could answer your initial question but maybe its best you start another question for this. Assuming your initial question has been answered? Did you manage to get the value from the cell?
ASKER
Thanks for your help. I couldn't have done it without your helpl.
Very glad that i was able to help in some way :)
Apresto
Apresto
ASKER
Dim lbl As Label = dvCustomer.FindControl("La
Then used lbl.Text to get me the value. As far as you know, is this the best way to do this?