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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid - Get row data when clicking a button.

Status
Not open for further replies.

Garreth21

Programmer
May 19, 2005
29
Hi everyone,

I have a datagrid for a simple shopping cart app i'm developing. I've got a template Column that contains a asp button which will add the product to the shopping cart.

Right now I'm using the OnItemCommand event, and i'm able to display the product num on the screen. However, i've run into problems with the OnItemCommand taking over. I've since learned that I'd have to use CommandName to get around the issues i'm having.

My question is, is there another way to do what I'm doing currently without using OnItemCommand? So far this is the only way i've gotten it to work.

thanks



 
sorry...your talking about the html onItemCommand correct?

how is it taking over? what are you trying to do? the OnItemCommand is how you insert records from the grid.

 
Ad dvannyoy is pointing out we need more info. What I would do is add a checkbox to your template column and a button outside the grid. Then when the button is clicked, check if the checkbox in each row is checked(ItemDatabound Event) and add it to the cart.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top