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






Occurs when a datasource needs to be initialized during data binding.Manages delegates of the type DataSourceEventHandler.

Syntax

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

Event Data

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

PropertyDescription
AdditionalFilters  
DataSource Gets or sets the DataSource for the control. Gets or sets the DataSource for the control.
EndRow  
IsDropDownClicked Specifies whether the dropdown is clicked.
IsFlyDataRequest Specifies whether the WebCombo's data request invoke a Postback.
QueryText  
ReturnValue (Inherited from ISNet.WebUI.WebCombo.BaseEventArgs) 
RowCount Gets row count that will be retrieved from DataSource.
StartRow Gets start rows that will be retrieved from DataSource

Example

The following example show you how to create and bind WebCombo programmatically using InitializeDataSource event (old databinding mode in WebCombo.NET 3.0)
C#Copy Code
private void wc_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)
{  
    DataSet ds = new DataSet();  
    OleDbDataAdapter1.Fill(ds, "Customers");  
    e.DataSource = ds;  
    WebCombo1.DataTextField = "ContactName";  
    WebCombo1.DataValueField = "CustomerID";
}

Remarks

In WebCombo.NET 3.0, using InitializeDataSource event users can make the data source bounded using e.DataSource (old databinding mode). You can also configure DataTextField and DataValueField properties of the WebCombo programmatically at this event.

WebCombo.NET 4.0 introduces you to a new code-less data binding. Binding is supported through DataSource support. With this new datasource control concept, InitializeDataSource event is no longer fired when the WebCombo is bound to DataSourceID. This event will still be fired normally when the DataSourceID property is empty (old databinding mode). Programming databind web application is very easy, simple and straightforward. There are no codes that required in the page’s code behind if you use datasource control. To give you better understanding on code-less data binding, you can read: Walkthrough: Binding WebCombo to AccessDataSource control, Walkthrough: Binding WebCombo to ObjectDataSource control, and Walkthrough: Binding WebCombo to ISDataSource control.   

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.