Intersoft WebCombo Documentation
How-to: Add item in bound WebCombo
See Also Send comments on this topic.
Intersoft WebCombo > WebCombo Features Overview > Dynamically Add Item How-to Topics > How-to: Add item in bound WebCombo

Glossary Item Box

In WebCombo, you are able to add new item in WebCombo.

This topic will show you how to Add Item in bound WebCombo.

To add Item in bound WebCombo

  1. Set AllowAddItem in WebCombo.
  2. Drag AccessDataSource control to the page.
  3. Click the AccessDataSource instance and press F4.
  4. Set EnableCaching to True from the properties box.
  5. On the WebCombo's AddItem event handler, put the following code :

    C# Copy ImageCopy Code
    protected void WebCombo1_AddItem(object sender, ISNet.WebUI.WebCombo.RowEventArgs e)
    {        
       // get cached data from data source control        
       DataView view = this.EmployeeDataSource.Select(DataSourceSelectArguments.Empty) as DataView;        
    
       // update the cached data
       DataTable table = view.Table;
       DataRow newRow = table.NewRow();
       newRow["FirstName"] = e.Row.Value;
       table.Rows.Add(newRow);
    }
    

  6. Run the project.

See Also