Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1815
Changing DataSource
posted

On a Windows form I have an Ultaoptionset that I use to control the data source for an ultracombo.

The idea is that the user clicks on the radio button in the Ultraoptionset to control  the type of product data they see in the ultracombo

I use the following to set/reset the datasource:

Dim DS As New DataSet()

Dim DA As New SqlDataAdapter(SQLCmd)

 DA.Fill(DS)

 ucMedicationItem.DataSource = DS.Tables(0)

and that seems to work okay. However, I have a couple of issues. One problem is that even with the LimitToList option set to False

the ultraCombo _ItemNotInList event always fires. I was not expecting that.

But what I really want is to limit the user to the list so that is less of an issue.

What I need is to allow the user to enter a text value in the ultracombo text box and then have it drop down the list, this is working okay BUT

if the user does not see what they want in that drop down list they are to click on the Ultaoptionset to change  the type of product data that is listed

and I rerun the query. Part of the problem is that if the user enters even simple text like "a" and the combo drops down (fine) if the user does not see

what they want in the list then the user will click on the Ultaoptionset to change  the type of product data.

Currently they have to click on the the Option set twice (problem) to change the value of it and then after the dataset if changed and reloaded

only after the user blanks out and rekeys the text value does the combo box filter properly. After changing the data source I do not want them to

have to rekey the value I just want the data in the list to change and for it to be filtered as per the entry in the existing text value in the combobox.

Please help as I have been trying lots of various things but I just cannot seem to get this to work. Thank you

  • 469350
    Offline posted

    Hi,

    skalyniuk said:
    Currently they have to click on the the Option set twice (problem) to change the value

    I don't think there is any way around this. This is the standard behavior for ComboBox controls in DotNet. The first click closes the Combo, so you have to click again to affect the control under the mouse.

    skalyniuk said:

    then after the dataset if changed and reloaded only after the user blanks out and rekeys the text value does the combo box filter properly.

    I'm not quite sure what this means, but it sounds like you are saying that setting the DataSource on the Combo is blanking out the text. Is that right?

    If that's the case, then it should be very easy for you to store the Text of the Combo in a variable before you set the DataSource. Then, after you set the DataSource, you could set focus to the combo to put it into edit mode and set the Text back to what it was.