Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Validating numeric data in datagrid
I am new to vb.net.Presently i am using VS 2010,SQL server 2008 express R2 and developing a windows application in vb.net
I one form i am using datagrid with 3 columns.
1 col : databound ,type combobox
2 col : text bx
3 col : text box
I want user to choose value from combobox and enter only numeric value in 2nd and 3rd column.I am writing following code :
Private Sub DataGridView1_CellValidating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles Dg_bill.CellValidating
If Dg_bill.CurrentCell.ColumnIndex = 1 Then
If Not IsNumeric(Dg_bill.Item(1, 0).Value) Then
MessageBox.Show("error aa gia je")
but the error msg is displayed for all values even when i enter numeric value like '1'.Plz help also in debugging i found Dg_bill.Item(1, 0).Value contains nothing alwyz
0 · ·