multiple bookmarks in the DBGrid control

Started by nandagopal, May 20, 2009, 07:01 PM

Previous topic - Next topic

nandagopal

When the user selects rows, the rows' bookmarks are stored in the DBGrid's SelBookmarks collection. You can save those bookmarks and restore them later to reselect the rows.


Private m_SavedBookmarks As Collection

' Save the bookmarks.
Private Sub cmdSaveBookmarks_Click()
Dim i As Integer

    Set m_SavedBookmarks = New Collection
    For i = 0 To DBGrid1.SelBookmarks.Count - 1
        m_SavedBookmarks.Add DBGrid1.SelBookmarks(i)
    Next i

    cmdRestoreBookmarks.Enabled = True
End Sub

' Restore the bookmarks.
Private Sub cmdRestoreBookmarks_Click()
Dim book_mark As Variant

    ' Remove existing bookmarks.
    With DBGrid1.SelBookmarks
        Do While .Count > 0
            .Remove 0
        Loop
    End With

    ' Restore the saved bookmarks.
    For Each book_mark In m_SavedBookmarks
        DBGrid1.SelBookmarks.Add book_mark
    Next book_mark
End Sub



redroses

I was having this same problem until today. I thought that was the issue, then I found this post - sure enough it works now.
simulation credit immobilier


ganeshbala


pradeep prem

from this db grid program it can easily use in vb.net

the full program has given in this site

but it take some error means how to solve