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






Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

Syntax

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

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 following example shows you how to performs row delete using DeleteRow event.
C#Copy Code
private void WebGrid1_DeleteRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
        DataSet ds = (DataSet)WebGrid1.DataSource;
        // update the deleted row using proper dataadapter for each datatable.
        if (e.Row.Table.DataMember == "Customers") 
        {
                oleDbDataAdapter1.Update(ds.Tables["Customers"]);
        }
        else if (e.Row.Table.DataMember == "Orders") 
        {
                oleDbDataAdapter2.Update(ds.Tables["Orders"]);
        }
        else 
        {
                oleDbDataAdapter3.Update(ds.Tables["Order Details"]);
        }
}

Remarks

Using DeleteRow 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.