Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » .NET Programming » Visual Basic .NET » Refreshj problem with datagridview


Refreshj problem with datagridviewExpand / Collapse
Author
Message
Posted 7/2/2009 3:57:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/15/2010 12:04:30 PM
Posts: 5, Visits: 9
Hello Everyone,

  I have two forms. I am enetering the values to be saved in the database in one form and another
form is displaying those values in a DatagridvIew.Eything is working except that when I eneter the value on
first form and hit the save botton, the values are not reflected immediatley on my second form datagridview.
 Although when I hit the save button on the first form, immediatley after that I am rebinding my datagridview again and
I am Refreshing the datagridview and also the form itself, but nothing seems to be working.

Can anyone help me with that. Below is my code that has the datgridview
Private Sub bindGrid(ByVal dv As DataView)
        Try
            Dim ChatsChild As New edsChild
            Dim dt As New DataTable
            dt = dv.ToTable()
            grdPreviousCases.DataSource = dt
            grdPreviousCases.Refresh()
            Me.Refresh()

        Catch ex As Exception

        End Try

    End Sub

below is the code of the form that lets me save the data

 If saveCase( cmbRegion.Text, txtNameLast.Text, txtNameFirst.Text, txtNameLast2.Text, txtNameFirst2.Text, txtPhone1.Text) Then
{
                PreviousCases.setUpdateStatus(1)
                PreviousCases.Refresh()
                Close()
}

PrevousCases is my second form name. PreviousCases.setUpdateStatus(1) calls the bindGrid method.

Can anyone help me with this. I might be missing somethig here or may be it is not possible to refresh the form at all.

Post #27868
Posted 7/7/2009 8:49:33 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 2/24/2010 10:21:15 AM
Posts: 632, Visits: 1,016
From what I read you're using a datagrid. (?)

Most database-bindable controls have a "databind()" method. Try using this.



-Mobius

Post #27898
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 5:06am