473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Execute a sub function in gridview

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

Oct 2 '06 #1
2 5374

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 : sh*********@hotmail.com

"Deere" <me******@gmail.comwrote in message
news:11********************@i3g2000cwc.googlegroup s.com...
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

Oct 2 '06 #2
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

Shahzad Godil wrote:
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 : sh*********@hotmail.com

"Deere" <me******@gmail.comwrote in message
news:11********************@i3g2000cwc.googlegroup s.com...
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
Oct 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin B | last post by:
Hallo to everyone! Problem: -------- GridView Exception: reentrant call to the SetCurrentCellAddressCore function System: ------- WinXP Professional, english, .NET Framework 2.0 Beta...
4
by: sck10 | last post by:
Hello, I am using the following GridView control. What I would like to do is for each row, test to see if the DataField="Product" value = "Total". If so, make the text for each bound field bold....
1
by: Edwin Knoppert | last post by:
I post this again, no answer before. During the beta version it worked, the same code does no longer work in the new release. I have a simple gridview with ButtonField, the button deletes a...
2
by: | last post by:
I want to know how to make a clickable button or Command field on a GridView, and have the user's action a) fire a function and b) pass a data value from one of the GridView's columns to that...
0
by: russganz | last post by:
I have a gridview that displays user ratings as 'stars' from a jpg file. The template field is defined as <asp:TemplateField HeaderText="User Rating"> <ItemTemplate> <img src='<%#...
3
by: Jerzy Zielinski | last post by:
Hi all, I would like to execute/evaluate a string that contains a VB script, for example: Dim s as string = "Dim avar as integer = 1" ' Evaluate s... so s can be executed during runtime and...
2
by: jonny | last post by:
How can I do this with ASP controls & VB.NET On click of button run query to fill gridView.
1
by: gabe | last post by:
How do you call a client side javascript callback method after an update panel has posted back to the server? I have two update panels (A + B) with a gridview in each panel. GridView B has a...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.