views:

8

answers:

0

i have a gridview whose scroll bars r selected "Both"......now this grid view in updated by a new datasouce in other thread.....but problem in when it is updated its vertical scroll bar diss appears and even not settled when i set it in other thread ...Here is the code

Public Sub LoadList()
    dgvRFQs.DataSource = MyDal.GetAllQuotations()
    dgvRFQs.ScrollBars = ScrollBars.Both
    dgvRFQs.SelectionMode = DataGridViewSelectionMode.FullRowSelect
End Sub



Public Sub frmMain_Load(ByVal sender As System.Object, 
       ByVal e As System.EventArgs) Handles MyBase.Load

    Try
          dgvRFQs.ScrollBars = ScrollBars.Both
        frm_TD_Main.CheckForIllegalCrossThreadCalls = False
        Dim thread As New System.Threading.Thread
               (New System.Threading.ThreadStart(AddressOf Me.LoadList))

        thread.Start()
        dgvRFQs.ScrollBars = ScrollBars.Both
        dgvRFQs.SelectionMode = DataGridViewSelectionMode.FullRowSelect
        'dgvRFQs.DataSource = MyDal.GetAllQuotations()


    Catch ex As Exception
        MsgBox("Runtime Error: " & Err.Number & vbCrLf 
             & "Internal Error Code: TD_MN001" 
             & vbCrLf & "Error occured while processing your request.", 
            MsgBoxStyle.Information, "Message")
    End Try

End Sub

Please Help.....