?
Solved

Are u sure u want to delete row?

Posted on 2006-10-27
4
Medium Priority
?
247 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 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