I have to replace .net Listbox with Component one C1List from existing application. Previously it items were added like below.
lstFrmType.Items.Add(New DictionaryEntry("False",
FormatPercent(-0.1234,
CInt(numFrmDecimalPlaces.Value),
TriState.True,
TriState.False,
TriState.False)))
But for component one C1list i can see that it have new mehtod AddItem() but it only accept the parameter as string. I cannot add DictionaryEntry object.
lstFrmType.AddItem(New DictionaryEntry("False",
FormatPercent(-0.1234,
CInt(numFrmDecimalPlaces.Value),
TriState.True,
TriState.False,
TriState.False)))
Is there any other way to achieve this?
There are certain limitations when you use
C1Listin unbound mode (AddItemis possible only in unbound mode). In an unbound mode you cannot useDisplayMember/ValueMemberwhich you would definitely need here to use yourDictionaryEntryobject. Therefore it is better to use bound mode (DataMode = Normal). You can write an extension that looks as if we are usingAddItembut behind the scene you can push data into list'sDataSource.The only limitation with this method is that you have to implement this extension as per you DataSource type.