Torna al Thread
'bnsChecklist è il mio bindingsource
'bnvChecklist è il mio bindingnavigator
Public ds_risposte As DataSet = New DataSet("SingolaRisposta")
Public dt_risposte As New DataTable("Risposte")
Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
Me.Controls.Add(Me.bnvCheckList)
Me.bnsChecklist.DataSource = Me.dt_risposte
Me.txtCodDomanda.DataBindings.Add(New System.Windows.Forms.Binding("Text", _
Me.bnsChecklist, _
"CodDomanda", _
True))
Me.chkOK.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", _
Me.bnsChecklist, _
"OK", _
True))
Me.chkIN.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", _
Me.bnsChecklist, _
"IN", _
True))
Me.chkNC.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", _
Me.bnsChecklist, _
"NC", _
True))
Me.chkNA.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", _
Me.bnsChecklist, _
"NA", _
True))
Me.txtPuntAssegnato.DataBindings.Add(New System.Windows.Forms.Binding("Text", _
Me.bnsChecklist, _
"PuntAss", _
True))
If CDec(txtPuntAssegnato.Text) > CDec(txtPuntMax.Text) Or CDec(txtPuntAssegnato.Text) < 0 Then
MessageBox.Show(String.Format("Inserire un valore compreso tra 0 e {0}", CDec(txtPuntMax.Text)), "Informazione", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Me.txtCommento.DataBindings.Add(New System.Windows.Forms.Binding("Text", _
Me.bnsChecklist, _
"Commento", _
True))
Me.Validate()
Me.bnvCheckList.BindingSource = Me.bnsChecklist
End Sub