I am working on VB.Net. I have a sub form with a datagridview, that is being loaded with the criteria taken from another form. Hence this form is called with parameters. Here is the code that calls the sub form.
Dim frmHis As New frmHist(ds, rb) frmHis.Show()
where ds is the dataset to fill the datagridview and rb is the string from a radio button on this form.
Here is the code in the sub form.
Public Sub New(ByVal datset As DataSet, Optional ByVal Head As String = "") ' This call is required by the Windows Form Designer. gdatset = datset InitializeComponent() grdHist.DataSource = datset.Tables(0) ' Add any initialization after the InitializeComponent() call. Label1.Text = Head End Sub
Now, I need to refresh this sub form every -- minutes, depending on how the user wants it to be. For this I have given a NumericUpDown control to select the mins. All this works fine. But how do I refresh the dataset and the datagridview?