We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Delete confirmation for a row in datagrid

I tried the "5.54 How can I put up a confirmation question when the user tries to delete a row in the datagrid .." but it didn't work. the function wasn't overriden. Did someone tried it or has another way to ask a question and wait for the response of the user before deleting the datagrid row?

2 Replies

AD Administrator Syncfusion Team January 17, 2003 01:39 PM UTC

try this: Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean If keyData = Keys.Delete Then If IsSelected(Me.CurrentCell.RowNumber) Then 'if you don't want to process that key Return True 'else do nothing End If End If Return MyBase.ProcessCmdKey(msg, keyData) End Function > I tried the "5.54 How can I put up a confirmation question when the user tries to delete a row in the datagrid .." but it didn't work. > > the function wasn't overriden. Did someone tried it or has another way to ask a question and wait for the response of the user before deleting the datagrid row?


GG ggron February 2, 2003 08:09 PM UTC

The code is working fine but I want understand it. Is ProcessCmdKey a datagrid class's function ? I don't find this function in box "method name", in VS IDE. Where is it ? thanks! ggron joinus@ggron.com > try this: > > Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean > > If keyData = Keys.Delete Then > If IsSelected(Me.CurrentCell.RowNumber) Then > 'if you don't want to process that key > Return True > 'else do nothing > End If > End If > > Return MyBase.ProcessCmdKey(msg, keyData) > End Function > > > > > I tried the "5.54 How can I put up a confirmation question when the user tries to delete a row in the datagrid .." but it didn't work. > > > > the function wasn't overriden. Did someone tried it or has another way to ask a question and wait for the response of the user before deleting the datagrid row? >

Loader.
Live Chat Icon For mobile
Up arrow icon