Intersoft WebGrid Documentation
DataSourceID Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : DataSourceID Property






Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.

Syntax

Visual Basic (Declaration) 
<NotifyParentPropertyAttribute(True)>
<DescriptionAttribute("Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.")>
<DefaultValueAttribute()>
<IDReferencePropertyAttribute(System.Web.UI.DataSourceControl)>
<ISNet.Serialization.BinarySerializableAttribute()>
<CategoryAttribute("Data")>
Public Property DataSourceID As String
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim value As String
 
instance.DataSourceID = value
 
value = instance.DataSourceID
C# 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.")]
[DefaultValueAttribute()]
[IDReferencePropertyAttribute(System.Web.UI.DataSourceControl)]
[ISNet.Serialization.BinarySerializableAttribute()]
[CategoryAttribute("Data")]
public string DataSourceID {get; set;}
Delphi 
public read-write property DataSourceID: String; 
JScript 
NotifyParentPropertyAttribute()
DescriptionAttribute("Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.")
DefaultValueAttribute()
IDReferencePropertyAttribute(System.Web.UI.DataSourceControl)
ISNet.Serialization.BinarySerializableAttribute()
CategoryAttribute("Data")
public function get,set DataSourceID : String
Managed Extensions for C++ 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.")]
[DefaultValueAttribute()]
[IDReferencePropertyAttribute(System.Web.UI.DataSourceControl)]
[ISNet.Serialization.BinarySerializableAttribute()]
[CategoryAttribute("Data")]
public: __property string* get_DataSourceID();
public: __property void set_DataSourceID( 
   string* value
);
C++/CLI 
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets the ID of the control from which the WebGrid control retrieves its list of data rows.")]
[DefaultValueAttribute()]
[IDReferencePropertyAttribute(System.Web.UI.DataSourceControl)]
[ISNet.Serialization.BinarySerializableAttribute()]
[CategoryAttribute("Data")]
public:
property String^ DataSourceID {
   String^ get();
   void set (    String^ value);
}

Remarks

WebGrid.NET 5.0 allows you to perform codeless databinding which you can configure the datasource, its connection and its related property without writing codes. The Grid will bound to a datasource control through DataSourceID property. The Grid connects to the specified datasource control and display data from the datasource available in SqlDataSource (Please look at the statement below).

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<$ ConnectionStrings>" SelectCommand="SELECT * FROM [Tasks]"></asp:SqlDataSource>

 

<ISWebGrid:WebGrid ID="WebGrid1" runat="server" DataSourceID="SqlDataSource1" Height="300px” HorizontalAlign="NotSet" Width="100%">

</ISWebGrid:WebGrid>

With this new databinding concept, programming databind web application is very easy, simple and straightforward. There are no codes that required in the page’s code behind. In previous version, you will need to configure InitializeDataSource event and write codes inside the event which pass the datasource to e.DataSource. That is no longer needed in WebGrid.NET Enterprise version 5.0, although the old databinding mechanism is still supported for backward compatibility.

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

Reference

WebGrid Class
WebGrid Members

Concepts

Design-time support for DataSourceControl
No-codes data binding through DataSourceControl support

Oher Resources

The benefits of the new DataSource control binding support

©2012 Intersoft Solutions Corp. All Rights Reserved.