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






Occurs when ChildRows DataSource is retrieved in load on demand mode.

Syntax

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

Event Data

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

PropertyDescription
CustomRequestData Gets the custom request data string send from client's request.
DataSource Gets the assigned WebGrid's DataSource object.
ParentConstraints Gets the constraints of parent's WebGridRow object which initiated the event.
ParentKeyValues Gets the constraints of key values' WebGridRow object which initiated the event. 
ParentObject Sets the current object of which collection is retrieved for hierarchical object binding purpose.
ReturnValue (Inherited from ISNet.WebUI.WebGrid.BaseEventArgs) 
Table Gets the WebGridTable object used by the event.

Example

 

The sample codes below show how to create LoadOnDemand using InitializeSelfReferenceDataSource event.
C#Copy Code
private void WebGrid1_InitializeSelfReferenceDataSource(object sender, ISNet.WebUI.WebGrid.ChildTableDataSourceEventArgs e)
{
    DataTable dt = (DataTable)e.DataSource;
    oleDbDataAdapter1.SelectCommand.CommandText = "select * from employees where ReportsTo = " +  e.ParentKeyValues["EmployeeID"].ToString();
    oleDbDataAdapter1.SelectCommand.CommandType = CommandType.Text;
    oleDbDataAdapter1.Fill(dt);
}

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.