You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Topic closed
Hello Jing,
Why does the dropdownlist seletecteditemchanged event not fire when you set the value directly? I set the code like your example: "sheet["B2"] = "Apple";." When i first setup the ddl, i set to first item in the list and when it changes, i have update a class with the index value and dispalytext, but i notice, when set like you said, it does not fire the event, so it never update the class. When you change the in the sheet it will fire and update the class.
Shane
This form the worksheet setup
'Initializes a new instance of the ddl control and sets the default values
ddlGYWSBetterIf = New SigmaAid.Controls.DropdownListCell(My.Resources.strLowerTitle, My.Resources.strHigherTitle,
My.Resources.strCloseToTarget)
'set the SelectedItemsChanged event handle to the control
AddHandler ddlGYWSBetterIf.SelectedItemChanged, AddressOf ddlGYWSBetterIf_SelectedItemChanged
'Sets the default setting for the control
With ddlGYWSBetterIf
.DropdownPanelHeight = 50
End With
'Sets the ddl control to the cell
rgGreenYSheet("B4") = ddlGYWSBetterIf
'Sets the default Value
rgGreenYSheet("B4") = My.Resources.strHigherTitle
The Event code
Private Sub ddlGYWSBetterIf_SelectedItemChanged(sender As Object, e As EventArgs)
Dim ddl As SigmaAid.Controls.DropdownListCell = DirectCast(sender, SigmaAid.Controls.DropdownListCell)
'Checks to see if the index has changed
If Not ddl.SelectedIndex.Equals(ProjectInfo.BetterIfIndex) Then
With ProjectInfo
.BetterIfIndex = ddl.SelectedIndex
.BetterIfText = ddl.Cell.DisplayText
End With
End If
End Sub
Offline
Hi Shane, I think it's better to use CellDataChanged instead of SelectedItemChanged. Cell and Drop-down list are two separated objects, Drop-down list updates cell's data when selected item changed, but cell doesn't update its value to drop-down list, since the value may doesn't exist in the drop-down's candidates list.
Offline
Pages: 1
Topic closed