access textbox values that are unbound in datagrid

N

.NetNewbie

I am a .NET newbie and have a simple question.

I have a simple web form wherein the user can enter qty (which is a
textbox field) for items he wants to purchase. All the columns in the
datagrid on that form are bound except for the qty column which is of
type templatecolumn and contains a textbox.

I have a buy button at the bottom of the form. When the user click on
that button, I want to find out

1) which items the user wants to buy
2) and how much qty he specified

How do I do this? Any help would be greatly appreciated.
 
E

Elton Wang

Hi there,

You can loop thru items (rows) of the datagrid to process.

Which items:
Either have a check box to let user select or find out filled qty text
boxes.

How much qty:

TextBox txtQty = (TextBox)datagridItem.FindControl("qty_textbox_id");
string strQty = txtQty.Text;
int intQty = Convert.ToInt32(strQty);

HTH

Elton
 

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