Drilling Down to the very Data in the FormView/DataGrid

K

Kivak

Hey everyone,

I know we have to be able to do this, or Microsoft was stupid. How do
we get down to the very variables in the DataGrid and FormView? Lets
say I have a table to hold a product ID and the product name...

-----------------------
| ID: | Name: |
| 1 | MyProduct1 |
| 2 | MyProduct2 |
| 3 | MyProduct3 |
| 4 | MyProduct4 |
-----------------------

This is from a SQL database where "ID" is from the variable
"product_id" and "Name" is from the variable "product_name". How would
I call a function (sort of like "SELECT") where when i clicked on the
button it would be able to give me the value of the variable
"product_id" of the row I clicked. In other words, if I clicked on the
button that was next to the product called "MyProduct1" the function
would return "1" because the variable "product_id" in that row is equal
to 1.

Does anyone know how to do that in VB.NET and ASP.NET 2.0?
 
I

intrader

Hey everyone,

I know we have to be able to do this, or Microsoft was stupid. How do
we get down to the very variables in the DataGrid and FormView? Lets
say I have a table to hold a product ID and the product name...

-----------------------
| ID: | Name: |
| 1 | MyProduct1 |
| 2 | MyProduct2 |
| 3 | MyProduct3 |
| 4 | MyProduct4 |
-----------------------

This is from a SQL database where "ID" is from the variable
"product_id" and "Name" is from the variable "product_name". How would
I call a function (sort of like "SELECT") where when i clicked on the
button it would be able to give me the value of the variable
"product_id" of the row I clicked. In other words, if I clicked on the
button that was next to the product called "MyProduct1" the function
would return "1" because the variable "product_id" in that row is equal
to 1.

Does anyone know how to do that in VB.NET and ASP.NET 2.0?
First, no different in 1.1 than 2.0.
It is all about Object Oriented Programming(plus the additional difficulty
of sending the info to the web).
Imagin each cell in the grid to be an element in an array of rows.
Whatever you put in the cells is an object with some representation in the
DOM (Document Object Model) at the server (there is also a DOM at the
client (but this you access at the client in Javascript).
 
K

Kivak Wolf

Can you show me the code for it?

BTW Jay, your E-mail didn't send, send it to me
"(e-mail address removed)"
 
K

Kivak Wolf

weird, it does not show it. here:

l i t t l e w o l f e e @ g m a i l . c o m

TY =)
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top