473,320 Members | 1,817 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,320 software developers and data experts.

Customer Action in GridView

3
I am having an issue creating a column in a GridView control using c#. when the user clicks the delete link i want the logic to delete the database record and also an associated file. thusly i created a page that using a paramater passed in the url would display a confirmation message then delete the file. I am simply trying to insert a TemplateField containing a link to my delete confirm page. the problem is that im not sure how to insert the needed information into the link i.e.(the file id from the DataKeyNames array) Here is the code i am using for my GridView

<asp:GridView ID="gvTempFiles" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="FileID" DataSourceID="TempFileDataSource"
>
<Columns>
<asp:BoundField DataField="FileName" HeaderText="FileName" SortExpression="FileName" />
<asp:BoundField DataField="FileDesc" HeaderText="FileDesc" SortExpression="FileDesc" />
<asp:BoundField DataField="FileType" HeaderText="FileType" SortExpression="FileType" />
<asp:TemplateField>
<ItemTemplate>
<a href="PicDetail.aspx?id="" >Delete</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Thanks for any help you can give
Mar 21 '07 #1
2 1724
sani723
117 100+
use the DeleteCommand event to do this, and also use the alert("") for confirmation instead of transferring to another page.
Mar 22 '07 #2
TeamN2
3
Is there a simple way to get back the selected datakey when using the rowdelted or rowdeleting event. so far whenever i have tried to use either of these event the selecteddatakey is always set to null
Mar 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mark Harris | last post by:
I have an installer which uses a Customer Information page in it, is there an easy way to pass the serial number entered to a custom action? If not, where would i find the serial number in the...
6
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
6
by: RobR | last post by:
We have a customer using our application that has a problem. Within our app, we have a two different forms (one generates an email, the other a fax via a webservice). When they click the submit...
3
by: Rabbit | last post by:
Hi, I'm having a GridView with Datasource being set from CodeBehind method, its has a "RecID" databound field set as invisible. I want to utilize the "Delete" commandfield, so that on...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
4
by: Davey | last post by:
Hi All, I am learning .NET. I am a little confusing about when do I need a customer installer. I can add the Installer class in my WinForm project. But I don't know what the purpose of that....
2
by: Gunawan | last post by:
Hi, I would like to execute a function when user click on a commandfield (deletecommandfield) from a gridview. How can I do that? I can not find how to put code in it. Thank you In Advance Gun
1
by: ramprakashjava | last post by:
hi , i hav this error while running this customerDetails.jsp <html:html> <head> <html:base/> </head> <body> <html:errors/> <html:form...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.