Intersoft WebGrid Documentation
AddRow Event
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : AddRow Event






Occurs when adding a row is performed.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute()>
<CategoryAttribute("Behavior")>
Public Event AddRow As AddRowEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim handler As AddRowEventHandler
 
AddHandler instance.AddRow, handler
C# 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public event AddRowEventHandler AddRow
Delphi 
public event AddRow: AddRowEventHandler; 
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 AddRowEventHandler* AddRow
C++/CLI 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public:
event AddRowEventHandler^ AddRow

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.WebGrid.BaseEventArgs) 
Row Gets the WebGridRow object used by the event.

Example

 

The example below shows you how to add row Customer Table in AddRow Event.
C#Copy Code
private void WebGrid1_AddRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
   DataSet ds = (DataSet)WebGrid1.DataSource;

   if (e.Row.Table.DataMember == "Customers") 
   {
      // added row is for Customers table.
      // use proper dataadapter and call Update.
      oleDbDataAdapter1.Update(ds.Tables["Customers"]);
   } 
   else 
   {
      oleDbDataAdapter2.Update(ds.Tables["Orders"]);
   }
}

Remarks

Using AddRow Event, developers can write their own own implementation of update codes. To learn more on this event and editing functionalities you can read Editing Environment.

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.