freelanceprogrammers.org Forum Index » Visual Basic

Data Grid manipulation

View user's profile Post To page top
jpjamous@... Posted: Mon May 02, 2005 2:19 pm


Joined: 20 Apr 2005

Posts: 6
Data Grid manipulation
Here is the story. I am using a data grid on my form. I want to allow my
user to press the Delete key and erase a row in the data grid.

I used a procedure stating this:

` Deletes the selected item when the delete key is pressed:

Private Sub cbAppointmentTypes_KeyDown(ByVal sender As System.Object, ByVal
e As KeyEventArgs) Handles dgAppointmentTable.KeyDown



If e.KeyCode = Keys.Delete Then

call DeleteRecord()

End If

End Sub



This procedure fires up when one of the column captions are highlighted and
not the actual cells in the data grid. I cannot figure out how to make it
fire up when the cells in the datagrid are highlighted. I need to do so,
because I want the row`s index from the table to find out which row the user
wants deleted. Any help is greatly appreciated.




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.0 - Release Date: 4/29/2005



[Non-text portions of this message have been removed]
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help