?
Solved

Are u sure u want to delete row?

Posted on 2006-10-27
4
Medium Priority
?
246 Views
Last Modified: 2010-04-16
I need a message box asking the user if he wants to delete row?
0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 17818579
can u be more specific how do the user delete the row ?
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 17818583
by using the delete key in the grid (it's a grid rt)

or by using some button in the form ?
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 1000 total points
ID: 17818597
u could trap the delete key press in the grid in the grid key down..like


//hook event in constructor
AGrdi.KeyDown += new System.Windows.Forms.KeyEventHandler(AGrdi_KeyDown);




private static void AGrdi_KeyDown(object sender
                  , System.Windows.Forms.KeyEventArgs e)
            {
                  if(e.KeyCode == System.Windows.Forms.Keys.Delete)
                  {
                        System.Windows.Forms.DialogResult Result =
                              System.Windows.Forms.MessageBox.Show
                              ("Question","Mesage Caption",System.Windows.Forms.MessageBoxButtons.YesNo
                              ,System.Windows.Forms.MessageBoxIcon.Question);
                        if(Result == System.Windows.Forms.DialogResult.Yes)
                        {
                              //Delete Logic
                        }
                              
                  }
            }
0
 
LVL 11

Expert Comment

by:anyoneis
ID: 17824900
If you are using a DataGridView, set AllowUserToDeleteRows False, and provide a button to delete the selected grid row.

David
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question