Execute a sub function in gridview

D

Deere

Keep in mind I'm an old guy who is learning .net.

In asp classic I had a trash can icon in my shopping cart that would
delete a record.

In trying to accomplish the same in gridview I've used a template
column serveral different ways to try and execute a sub function in my
code behind and in a class... to no avail. It seems if I use a eval()
I need a return.

Would someone point me where I could see some code to do this.

Or point out the error in my thinking and show me the narrow path.

Thanks
 
S

Shahzad Godil

Very simple.

In Add/Remove Columns of GridView, select one command column name "Delete"
and make it available for gridview. Now on delete click, it will call
delete method define in DataSource and will delete record from your table
automatically.

If you want to manually call your delete command, you can write in
GridView_ItemCommand which will be fired with command name on "Delete" link
click.

Contact me on my MSN messenger if you still need any help

Thanks
Shahzad Godil
Karachi-Pakistan
MSN Messenger : (e-mail address removed)
 
D

Deere

Shazad thanks, I will look at that and if I have any problems I will
let you know.

One question though, are you able to execute a general sub function
from within a gridview column. I can execute a regular function with a
return through the eval() method. But how about a non-returning sub
function.

thanks again
Mark
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top