| List for WinForms Tutorials > Tutorial 21 Design-Time Support for C1Combo's AddItem Mode |
Design-time support for the AddItem mode of C1List is now available. The following steps demonstrate how to add items and set a layout at design time.
![]() |
Note: See Adding the C1List Components to a Project for information on adding a component to the Toolbox. |




To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
With Me.C1Combo1
.HoldFields()
.AddItem("Greg Daryll;0")
.AddItem("Jane Lambert;1")
.AddItem("Allen Clark;1")
.AddItem("David Elkins;1")
.AddItem("Carl Ziegler;0")
.AddItem("William Yahner;1")
End With
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1Combo1.HoldFields();
this.c1Combo1.AddItem("Greg Daryll;0");
this.c1Combo1.AddItem("Jane Lambert;1");
this.c1Combo1.AddItem("Allen Clark;1");
this.c1Combo1.AddItem("David Elkins;1");
this.c1Combo1.AddItem("Carl Ziegler;0");
this.c1Combo1.AddItem("William Yahner;1");
|
|

![]() |
Note: For faster data processing, use the AddItem method. |
For example, replace the code entered in the Form_Load event with the following code:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
With Me.C1Combo1
.HoldFields()
.SuspendBinding()
.AddItem ("Greg Daryll;0")
.AddItem ("Jane Lambert;1")
.AddItem ("Allen Clark;1")
.AddItem ("David Elkins;1")
.AddItem ("Carl Ziegler;0")
.AddItem ("William Yahner;1")
.ResumeBinding()
.Rebind()
End With
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1Combo1.HoldFields();
this.c1Combo1.SuspendBinding();
this.c1Combo1.AddItem ("Greg Daryll;0");
this.c1Combo1.AddItem ("Jane Lambert;1");
this.c1Combo1.AddItem ("Allen Clark;1");
this.c1Combo1.AddItem ("David Elkins;1");
this.c1Combo1.AddItem ("Carl Ziegler;0");
this.c1Combo1.AddItem ("William Yahner;1");
this.c1Combo1.ResumeBinding();
this.c1Combo1.Rebind();
|
|
In this tutorial only a small amount of data was used, so you may not notice a difference in the processing time. For larger amounts of data, use the AddItem method for a much faster processing time.
This concludes the tutorial.