HighTechTalks DotNet Forums  

Delete Template

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Delete Template in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jeremy Martin
 
Posts: n/a

Default Delete Template - 08-04-2006 , 03:41 AM







Hi,

I am using a datagrid to edit the ItemTemplate and EditItemTemplate
however I was wondering if there was a DeleteItemTemplate.

What I would like to accomplish is when they click the delete button
column it would reload the grid and one of the columns would have a
chkboxlist containing options on what to delete.

ie not just that record but let them choose to delete child records or
run routines

Thanks
Jeremy

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Delete Template - 08-09-2006 , 03:51 PM






Hi Jeremy,

I think this solution would be little clumsy, but u may want to try it
if it works for u.

1) write a "OnDeleteCommand" for the datagrid
2) invoke "OnEditCommand" from the "OnDeleteCommand", so that u run
your logic to list the checkboxes.
3) In the same "OnDeleteCommand" function check for that row if it has
those checkboxes, then perform your delete routine.

Hope this is not another problem for you!..

--Venkat

Jeremy Martin wrote:
Quote:
Hi,

I am using a datagrid to edit the ItemTemplate and EditItemTemplate
however I was wondering if there was a DeleteItemTemplate.

What I would like to accomplish is when they click the delete button
column it would reload the grid and one of the columns would have a
chkboxlist containing options on what to delete.

ie not just that record but let them choose to delete child records or
run routines

Thanks
Jeremy


Reply With Quote
  #3  
Old   
timmy123
 
Posts: n/a

Default Re: Delete Template - 08-10-2006 , 03:22 AM



Hi,

Use the OnDeleteCommand method to provide a custom event handler for the
DeleteCommand event. The DeleteCommand event is raised when the Delete button
is clicked for an item in the DataGrid control.

We will write an event handler for eacg event. We must also tell the DataGrid
that when the event fires, the event handler (eventHandler Name) should be
executed.
we do this by setting the DataGrids OnDeleteCommand property to the event
handler. Here, you can use session variables to store the data, delete the
row and adds the changes into a session and rebinds the grid.

You can try this book :"Develop your own Web Accounting application using ASP.
Net" by VK publishers.

Regards
tim

Jeremy Martin wrote:
Quote:
Hi,

I am using a datagrid to edit the ItemTemplate and EditItemTemplate
however I was wondering if there was a DeleteItemTemplate.

What I would like to accomplish is when they click the delete button
column it would reload the grid and one of the columns would have a
chkboxlist containing options on what to delete.

ie not just that record but let them choose to delete child records or
run routines

Thanks
Jeremy


Reply With Quote
  #4  
Old   
postmaster96
 
Posts: n/a

Default Re: Delete Template - 08-10-2006 , 11:40 PM



Find an example at:
http://www.programmingknowledge.com/simpleDataGrid.aspx



Jeremy Martin wrote:
Quote:
Hi,

I am using a datagrid to edit the ItemTemplate and EditItemTemplate
however I was wondering if there was a DeleteItemTemplate.

What I would like to accomplish is when they click the delete button
column it would reload the grid and one of the columns would have a
chkboxlist containing options on what to delete.

ie not just that record but let them choose to delete child records or
run routines

Thanks
Jeremy


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.