Hi,
I have a bounded Ultracombo having following items in the list.
ID Code--------------------1 A 2 B3 Ccombo is binded with a table having two columns, ID and Code. DisplayMember is Code and ValueMember is ID. Whenever we type any data that is not in the list then ValueChanged event is firing twp times. Lets say I typed D in combo then
First time UltraCombo.Value comes as null and second time it comes as the data I typed ( "D" ). This is happening in 9.1 version dlls.In 8.1 version dlls it was working fine ( ValueChanged event was firing only once ). We were using 8.1 dlls and out application was designed to check value null for invalid data. After upgading the dlls all these problems get started.. Its crashing our application..
Are you guys going to fix this bug?
Thanks,Dhananjay
I tried this out and I do not get the results you are describing.
I ran this code and selected item 2 from the list. I see a 2 in the Combo and the ValueChanged event fires with a 2.
Then I typed in a "4", and the ValueChanged event fired with a "4".
I am, of course, using the latest service release of the controls.
The control has to return the text you typed.When DropDownStyle is set to DropDown, it's perfectly valid to type something into the combo that is not on the list and you, the developer, have to be able to get the value from the combo.
So if this was returning null in some older version of the controls, then that was a serious bug and must have been fixed.
Hi Mike,
You might have not aware of that...Check the sample with Infragistics 8.2 version dlls. First select some valid value from the list then type invalid data and check the value.. it comes null.here is the sample code.private void ultraCombo1_ValueChanged(object sender, EventArgs e){ Debug.WriteLine(ultraCombo1.Value.ToString(), "ValueChanged");}private void Form1_Load( object sender, EventArgs e ){ DataTable dt = new DataTable( "Test" ); dt.Columns.Add( "ID", typeof( Int32 ) ); dt.Columns.Add( "Code", typeof( string ) ); dt.Rows.Add( 1, "A"); dt.Rows.Add( 2, "B"); dt.Rows.Add( 3, "C"); ultraCombo1.DataBindings.Clear(); ultraCombo1.SetDataBinding( dt, null);}execute this code with 8.2 version dlls.
Hi Dhananjay,
I'm not sure what earlier versions you are referring to. As far as I can remember (and I have been working here at Infragistics since before the UltraCombo existed), the control has always worked this way.
If you type in a value that is not on the list, the control's Value property returns the Text you typed in.
If you set teh DropDownStyle to DropDownList, then the user will be unable to type in an invalid value, and if you set the value in code to something that is not on the list, it probably returns null. But this behavior has not changed in any version as far as I know.
Why ultraCombo.Value is coming as invalid data? in earlier version dlls if we type invalid data ( If ValueMember does not match ) then Value was coming null. now its coming as typed invalid data... I think, earlier functionality was correct.. combo.Text should come as Typed text and Value should be null because ValueMember did not match.. Do you guys fix this Or this is new feature...?
ThanksDhananjay
I just tested this out in a small sample project and it seems to work fine for me. The event only fires once.
I am attaching the sample I used so that you can try it out and see if you get the same results. If you do, then there's some other factor at work in your application that is causing this. Maybe a property setting or the handling of an event.
If not, then it's probably because I'm usinga newer build than you and you should get the latest service release.