PC Review


Reply
Thread Tools Rate Thread

Delete row in datagrid

 
 
William Ryan
Guest
Posts: n/a
 
      8th Aug 2003
What are you having trouble with? Are you trying to make
a control, use it as a class etc?
>-----Original Message-----
>Hi, I have the VB code from
>http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q889q

..
>How do I implement it?
>
>
>.
>

 
Reply With Quote
 
 
 
 
Graeme Richardson
Guest
Posts: n/a
 
      8th Aug 2003
Hi, I want the function PreProcessMessage to fire (code below) when I select
a record and type the delete key.
I have a DataGrid called grdTown that is populated with data from a
DataTable called mdtTown [also a DataAdapter (madpTown) and
BindingBaseManager (mbmbTown)].

Cheers, Graeme.

Public Class SubClass_DataGrid

Inherits DataGrid

Private Const WM_KEYDOWN = &H100

Public Overrides Function PreProcessMessage(ByRef msg As
System.Windows.Forms.Message) As Boolean

Dim keyCode As Keys = CType((msg.WParam.ToInt32 And Keys.KeyCode), Keys)

If msg.Msg = WM_KEYDOWN And keyCode = Keys.Delete Then

If MessageBox.Show("Delete This Row?", "Confirm Delete",
MessageBoxButtons.YesNo) = DialogResult.No Then

Return True

End If

End If

Return MyBase.PreProcessMessage(msg)

End Function

End Class




 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
How do I delete a row in a DataGrid ? Unemployed Programmer Microsoft Dot NET 2 10th Jun 2005 04:06 PM
Delete Event when pressing delete in a datagrid? Lars Netzel Microsoft VB .NET 2 20th Jan 2005 02:38 PM
Delete mutiple rows in a dataGrid using delete Key =?Utf-8?B?TVZC?= Microsoft Dot NET Framework 0 26th Oct 2004 04:39 AM
DataGrid - Delete =?Utf-8?B?SmltIEhlYXZleQ==?= Microsoft ASP .NET 1 22nd Jul 2004 01:32 AM
Cannot delete last row in a datagrid Microsoft ADO .NET 0 29th Aug 2003 03:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:06 PM.