Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help retrieving values input into a TemplateColumn TexBox

Status
Not open for further replies.

Cenedra

Programmer
Jan 2, 2003
114
US
Basically what I have is a datadrid I'm filling with accessories for a product that can be ordered. In a TemplateColumn, I've added a asp:TextBox. This is the box a user would enter the Quantity of the accessory they want to order (if they want).

How do I loop through each DataRow in the DataGrid and check if a quantity was entered so I can add a record to my a database if there was valid data in the TextBox? Ideally I'd like to have an ImageButton that gets clicked and then the logic is processed.

Your help is greatly appreciated.
 
something along these lines...
Code:
dim i as integer = 0
dim txt as textbox

while i < datagrid.items.count
txt = ctype(datagrid.items(i).findcontrol("txtName"),textbox)

if IsNumeric(txt) then
  'do something
end if

i = i + 1
loop

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top