Intersoft WebCombo Documentation
AddItem Event
See Also  Example Send Feedback
ISNet.WebUI.WebCombo Namespace > WebCombo Class : AddItem Event






Occurs when adding an item is performed.Manages delegates of the type ISNet.WebUI.WebGrid.RowEventHandler.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute()>
<CategoryAttribute("Behavior")>
Public Event AddItem As RowEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebCombo
Dim handler As RowEventHandler
 
AddHandler instance.AddItem, handler
C# 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public event RowEventHandler AddItem
Delphi 
public event AddItem: RowEventHandler; 
JScript 
In JScript, you can handle the events defined by another class, but you cannot define your own.
Managed Extensions for C++ 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public: __event RowEventHandler* AddItem
C++/CLI 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public:
event RowEventHandler^ AddItem

Event Data

The event handler receives an argument of type RowEventArgs containing data related to this event. The following RowEventArgs properties provide information specific to this event.

PropertyDescription
ReturnValue (Inherited from ISNet.WebUI.WebCombo.BaseEventArgs) 
Row Gets the WebGridRow object used by the event. Gets the WebGridRow object used by the event.

Example

 

The following example shows you how to bind WebCombo to a Data Set and allow users to add item.
C#Copy Code
private void WebCombo1_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)
{
    oleDbDataAdapter1.Fill( dsNorthWind1 );
    e.DataSource = dsNorthWind1;
}

protected void OnAddItem(object sender, RowEventArgs e) 
{
    DataSet ds = (DataSet)WebCombo1.GetCachedDataSource();

    DataRow row = ds.Tables[0].NewRow();
    row["CustomerID"] = e.Row.Value;
    row["ContactName"] = e.Row.Value;  

    ds.Tables[0].Rows.Add(row);

    // performs update to physical datasource.
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.