Hello there.
My question is simple for U, but It's my second week using Infragistics Components.
How do I do to add new values in the UltraCombo.
Thanks
Hello laurent,
if you need to add a new row in the drop down list of the combo, i personaly add it to the DataScoure (DataSet, List<T>, etc)
for DataSet:
DataSet ds = (DataSet) this.myCombo.DataSource;
DataRow dr = ds.Tables[0].NewRow();
dr["MyValueColumn"] = 1;
dr["MyTextColumn"] = "Ne row Added";
EDIT: oups, didn't add the row to the DataSet.
ds.Tables[0].Rows.Add(dr);
for List<T>:
List<T> dl= (List<T>) this.myCombo.DataSource;
T newRow = new T ();
dl.Add(newRow);
* change T witht he list type ex(customer,Invoice, etc).
Hope that helped.
Nassos
I've a problem (my code is in VB)
Public Sub AddItem(ByVal Item As String)
Dim ds As DataSet = MyBase.DataSourceDim dr As DataRow = ds.Tables(0).NewRowds.Tables(0).Rows.Add(dr)dr(0) = "1"dr(1) = "New Item"
Can't convert from object to Dataset.
the problem is here:
Dim ds As DataSet = MyBase.DataSource
o think there is a function in VB CType() that mask from one type to another check MSDN for it
Of course it exists Ctype, but when I compile my code, it says it's an impossible conversion of type.I look for another thing, and I come back.
PS : thank U 4 your Help
UltraCombo requires a DataSource. So if you just want to put in a few simple values like this, I recommend using the UltraDataSource component as the data source of the Combo. You would create the UltraDataSource, add a couple of columns to the Band and populate them with data. Then set the ValueMember and DisplayMember on the combo to the appropriate fields.
Hi,
I'm trying to add these values in an UltraCombo named "ucMatched", how can i do this in C# ?
Thx a lot !