Click here to Skip to main content
15,896,279 members

Comments by Mandy Nagra (Top 37 by date)

Mandy Nagra 30-Jul-13 5:44am View    
Dim comm As New Common
Private EditRow As Integer = -1
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
EditRow = DataGridView1.CurrentRow.Index
If DataGridView1.CurrentCellAddress.X = 0 Then

'Handle the event(s) of the control while we are editing.
Me.column0ComboBox = DirectCast(e.Control, ComboBox)
End If
End Sub

Private Sub DataGridView1_CellEndEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
' SendKeys.Send("{TAB}")
Me.column0ComboBox = Nothing

End Sub




Private Sub GridMode_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dstemp As New DataSet
sqry = "sp_dtgLoad_tbitemmaster"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = 0
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp, "tbItemMasterHeader")
DataGridView1.DataSource = dstemp.Tables("tbBranchMaster")



Try
Dim dstemp12 As New DataSet
sqry = "sp_dtgLoad_tbitemmaster"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = 0
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp12, "tbBankMaster")
Column1.ValueMember = "itemId"
Column1.DisplayMember = "Itemname"
'DataGridView1.Rows.Add(1)
Column1.DataSource = dstemp12.Tables(0)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
'

Private WithEvents column0ComboBox As ComboBox

Private Sub column_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles column0ComboBox.SelectedIndexChanged
Dim dstemp As New DataSet

sqry = "sp_binditemsize"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = column0ComboBox.SelectedValue
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp, "tbItemMasterHeader")
DataGridView1.DataSource = dstemp.Tables("tbBranchMaster")

Try

Dim dstemp12 As New DataSet
sqry = "sp_binditemsize"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = column0ComboBox.SelectedValue
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp12, "tbBankMaster")
Column2.ValueMember = "itemsizeid"
Column2.DisplayMember = "SizeName"
Column2.DataSource = dstemp12.Tables(0)
'DataGridView1.Rows(EditRow).Cells(1).Value = dstemp12.Tables(0).Columns(3)


Catch ex As Exception
MsgBox(ex.Message)

End Try

End Sub
Private Sub DataGridView1_DataError(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DataGridView1.DataError
If (e.Context = (DataGridViewDataErrorContexts.Formatting Or DataGridViewDataErrorContexts.PreferredSize)) Then
e.ThrowException = False
End If
End Sub
Mandy Nagra 30-Jul-13 5:28am View    
problem is that when i select first row it work porperly .. but in second row second column it does't work properly .. it will showing some value as it show in first row second column
Mandy Nagra 30-Jul-13 5:03am View    
i want do do same in datagridview
Mandy Nagra 30-Jul-13 5:01am View    
in first row it work proprly.. but when i go to second row it will show same value in second row and 2nd column in datagridview
Mandy Nagra 29-Jul-13 8:32am View    
i want in datagridview cascading