|
-
Jun 29th, 2004, 01:45 PM
#1
Thread Starter
New Member
deleting from datagrid and displaying contents
I have a datagrid and the selected datarows' fields are displayed in fields below.
When I try to delete a row, then I advance to the next row, the correct row is not shown in the fields below; it tends to lag by one. However, all the records before the record deleted show up fine.
VB Code:
Private Sub btn_Del_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Del.Click
If objDS.Tables("phonebook").Rows.Count > 0 Then
Dim objDelRow As DataRow
objDelRow = objDS.Tables("phonebook").Rows(bmGrid.Position)
objDelRow.Delete()
moveprevious()
End If
ShowRecord(bmGrid.Position)
End Sub
Basically my question is there a way to skip through records that are marked as deleted when I scroll through the datagrid?
this si mah sig! 640k enuf for anyone!!!1111one one har har o_O
-
Jun 29th, 2004, 02:21 PM
#2
Frenzied Member
I believe there is a RowState property. Check that for Deleted and deal accordingly....i.e. move to next row.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jul 25th, 2004, 07:54 PM
#3
Lively Member
hi billiam!
I'm currently looking for a code in deleting records in a datagrid and fortunately, I found yours in this thread. Just wondering, what is the bmgrid in your code? I assumed that it is your datagrid, or not? Cause, when I changed your code to fit my program, it showed an error on the datagrid1.position part... the error is described as position is not a member of 'System.Windows.Forms.Datagrid'...
I hope you could assist me on this...please do reply soon! Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|