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
140
UltraCombo How to prevent row auto select?
posted

I have a problem with following code:

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// ->

DataTable dt = new DataTable("dt");
dt.Columns.Add("id", typeof(int));
dt.Columns.Add("name", typeof(string));
dt.Rows.Add(new object[] { 0, "000" });
dt.Rows.Add(new object[] { 1, "111" });

ultraCombo1.DataSource = dt;
ultraCombo1.ValueMember = "id";
ultraCombo1.DisplayMember = "name";
ultraCombo1.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.None;
ultraCombo1.RowSelected += new Infragistics.Win.UltraWinGrid.RowSelectedEventHandler(ultraCombo1_RowSelected);
}

void ultraCombo1_RowSelected(object sender, Infragistics.Win.UltraWinGrid.RowSelectedEventArgs e)
{
  // Event is Fired!
}

Then when i type "11" in UltraCombo control - second row selected and event RowSelected fired!

How to prevent this behavior?

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    I tried this out and the event fires twice. It fires once to select the second row (text: "111") and then again with the row as null.

    I think these events are correct, but they are a little weird. What happens is.. when you type in a "1", the first row gets selected because the "1" matches the value of the DataMember. Then when you type "11", there is no match, and so the event fires again with a null row.

    Why the first event doesn't fire until after you press the second character is a mystery and may be a bug.So I'm going to forward this to Infragistics Developer Support and have it looked into.

     

     

Reply Children