cancel
Showing results for 
Search instead for 
Did you mean: 

Clear selected value from combo box

Former Member
0 Kudos

hey guys,

I am using SBO 2005 and I cannot seem to get the selected value to clear from the combo box. I used this code in 2004 and it worked:fine

this.itemDetailForm.DataSources.UserDataSources.Item("shipList").ValueEx = "";

But it throws an exception when I try it in 2004 and when I look in the XML my shipList is not part of the userdata sources.

How do I clear this value in 2005?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Anyone know what I am doing wrong here? I just added a combo box through the screen painter and it isn't bound to anything. I just add some values to it through code. I want to reset the selected value how can I do that?

former_member184566
Active Contributor
0 Kudos

Hi Curtis

In 2004 i had the same problem, i'd clear the datasource and the actual selected value was still there even though the list was gone. Not 100% sure what my solution was at the end, but try the following for starters

try

If oCombo.ValidValues.Count > 0 Then

oCombo.ValidValues.Add("", "")

oCombo.Select(oCombo.ValidValues.Count - 1, SAPbouiCOM.BoSearchKey.psk_Index)

For i = 0 To oCombo.ValidValues.Count - 1

oCombo.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

Next i

End If

catch ex as exception

end try

Hope this helps

Former Member
0 Kudos

Thanks again Louis.

This will serve my purpose for now. I would really like to know how we can reset the combo box selection for future development.

former_member184566
Active Contributor
0 Kudos

Yes, me too.

Let me know if you find a suitable solution.

Answers (0)