Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Deleting rows in a datagrid

Reply
Thread Tools

Deleting rows in a datagrid

 
 
Ridhi
Guest
Posts: n/a
 
      01-02-2004
I have a datagrid wherein each row has a check box. the
user has to select the rows which he wants to delte. After
doing that and click "Delete" the user shpuld be prompted
for "Delete yes? or no?" id yes is clicked go ahead and
delete..or if no"Cancle the operation".Can anybody tell me
how to do this.

thanks in advance
 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      01-02-2004
Please examine the code provided, it achieves what you want.
private void TrunkGroup_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)

{

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)

{

LinkButton deleteButton = ((LinkButton)e.Item.Cells[0].Controls[0]);

deleteButton.Attributes.Add("onClick", "event.returnValue=confirm('Are you
sure you wish to delete this item?');");

}
}
--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/2bz4t
"Ridhi" <> wrote in message
news:01d601c3d175$08ba45f0$...
> I have a datagrid wherein each row has a check box. the
> user has to select the rows which he wants to delte. After
> doing that and click "Delete" the user shpuld be prompted
> for "Delete yes? or no?" id yes is clicked go ahead and
> delete..or if no"Cancle the operation".Can anybody tell me
> how to do this.
>
> thanks in advance



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Deleting multiple rows in Datagrid Nazar ASP .Net 0 08-14-2010 07:23 AM
Really urgent : Programmatically deleting Datagrid rows John ASP .Net 3 06-28-2006 05:00 AM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
Deleting multiple rows (Hotmail style datagrid) Darren ASP .Net Datagrid Control 0 01-21-2005 01:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57