Intersoft WebCombo Documentation
OnAddItem Method
See Also  Example Send Feedback
ISNet.WebUI.WebCombo Namespace > WebCombo Class : OnAddItem Method






row
Invoked when an item is about to be added.

Syntax

Visual Basic (Declaration) 
Public Overridable Function OnAddItem( _
   ByVal row As WebComboRow _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebCombo
Dim row As WebComboRow
Dim value As Boolean
 
value = instance.OnAddItem(row)
C# 
public virtual bool OnAddItem( 
   WebComboRow row
)
Delphi 
public function OnAddItem( 
    row: WebComboRow
): Boolean; virtual; 
JScript 
public function OnAddItem( 
   row : WebComboRow
) : boolean;
Managed Extensions for C++ 
public: virtual bool OnAddItem( 
   WebComboRow* row
) 
C++/CLI 
public:
virtual bool OnAddItem( 
   WebComboRow^ row
) 

Parameters

row

Example

 

The following example shows you how to create a WebCombo that you can add items to it.
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) 
{

    //retrieves the DataSet from internal cache then add new row to it.

    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);
}

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.