-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Balasubramanian1
Message 1 in Discussion


Hi
 
In data grid view i am using combo box 
,numericupdown, datetime picker.
 
I wrote combobox selected index change event but 
its triggering more than one time.
 
NumericUpDown and datetime picker is not visible in 
gridview whenever i am click on this control this is showing the 
updown.
 
How to solve this proble . Find the code for 
combobox evernt
 
 


Private Sub 
GrdContracts_EditingControlShowing(ByVal sender As System.Object, ByVal e As 
System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles 
GrdContracts.EditingControlShowing

Try

Dim CurrentColIndex 
As Integer

CurrentColIndex = GrdContracts.CurrentCell.ColumnIndex()

bolEventTrack = True

If CurrentColIndex = 2 
Or CurrentColIndex = 3 
Then

Dim editingComboBox 
As ComboBox = 
e.Control

AddHandler 
editingComboBox.SelectedIndexChanged, AddressOf 
Me.editingComboBox_SelectedIndexChanged

ElseIf CurrentColIndex 
= 4 Then

Dim editcalendercontrol 
As CalendarEditingControl 
= e.Control

AddHandler 
editcalendercontrol.ValueChanged, AddressOf Me.Calender_ValueChanged

ElseIf CurrentColIndex 
= 6 Then

Dim editNumericUpDown 
As 
NumericUpDownEditingControl = e.Control

AddHandler 
editNumericUpDown.ValueChanged, AddressOf Me.NumericUpDown_ValueChanged

End If

Catch ex As Exception

End Try



End Sub

 

 

 

Private Sub 
editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As 
System.EventArgs)

 

Dim CurrentColIndex 
As Integer

Dim strCellValue, 
strContractId As 
String

'If bolEventTrack = True 
Then

' bolEventTrack = False

'End If

intEventcount = intEventcount + 1

CurrentColIndex = GrdContracts.CurrentCell.ColumnIndex()

strContractId = GrdContracts.Rows(strRowNumber).Cells(8).Value

If CurrentColIndex = 2 
Then

strCellValue = CType(CType(sender, 
ComboBox).SelectedItem, String)

objContracts.UpdateContracts("Month", strContractId, 
objContracts.GetMonthId(strCellValue))

' FindDuplicateContract(strCellValue, 
strRowNumber)

ElseIf CurrentColIndex 
= 3 Then

strCellValue = CType(CType(sender, 
ComboBox).SelectedItem, String)

objContracts.UpdateContracts("Year", strContractId, strCellValue)

' 
FindDuplicateContract(GrdContracts.Rows(strRowNumber).Cells(2).Value, 
GrdContracts.Rows(strRowNumber).Cells(3).Value)

End If

''bolEventTrack = False

'MsgBox(intEventcount & " " & 
strCellValue & 
GrdContracts.Rows(strRowNumber).Cells(3).Value)

'====Trade sheet change for particular 
row

End Sub

 

Regards

Bala 
s

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to