Search:
Namespaces
Discussions
.NET v1.1
Feedback
problem related to datagrid
Messages
Related Types
This message was discovered on
ASPFriends.com 'winforms-cs' list
.
Mrinal Kamboj
Hi all ,
i am having a datagrid with delete button , which when pressed removes
the data from database , now i need to implement a an event handler in
between which confirms deletion before event occurence .
My present code is given underneath , here i am creating an object of that
button type and equating it equal to existing button and second line should
actually serve my purpose but it's not doing so may be because this control
is part of a datagrid :
can anyone help me out :
********************** CODE **********************************************
private void MyDataGrid_Delete(Object sender,
DataGridCommandEventArgs
e)
{
ImageButton
DeleteButton = ((ImageButton)(e.CommandSource));
DeleteButton.Attributes.Add("onclick","if(confirm('Are you sure you want to
delete this Date Format?')){}else{return false}");
objDateFormat_Master.DateFormat = dg_ModifyMaster.DataKeys[(int)
e.Item.ItemIndex].ToString();
int i = (
Int32
.Parse(Label2.Text)*dg_ModifyMaster.PageSize )+(int)
e.Item.ItemIndex;
objDateFormat_Master.DeleteDateFormat(objDateFormat_Master);
if((i>0)&&(i%dg_ModifyMaster.PageSize==0))
dg_ModifyMaster.CurrentPageIndex = dg_ModifyMaster.CurrentPageIndex - 1;
PopulateDataSet();
}
Reply to this message...
Roshni
Hi
You can use JavaScript to add a onclick event to the delete button to show a
message
Roshni
----- Original Message -----
From: "Mrinal Kamboj" <
Click here to reveal e-mail address
>
To: "winforms-cs" <
Click here to reveal e-mail address
>
Sent: Monday, August 12, 2002 1:40 PM
Subject: [winforms-cs] problem related to datagrid
[Original message clipped]
Reply to this message...
Vishal Joshi
(Type your message here)
--------------------------------
From: Vishal Joshi
Reply to this message...
Roshni
I'm sorry I thought it is a ASP.NET problem
Roshni
----- Original Message -----
From: "Roshni" <
Click here to reveal e-mail address
>
To: "winforms-cs" <
Click here to reveal e-mail address
>
Sent: Thursday, August 15, 2002 2:46 PM
Subject: [winforms-cs] Re: problem related to datagrid
[Original message clipped]
Reply to this message...
System.Int32
System.Web.UI.WebControls.DataGridCommandEventArgs
System.Web.UI.WebControls.ImageButton
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com