Back to Devexpress

ASPxDataWebControl.DataSourceID Property

aspnet-devexpress-dot-web-dot-aspxdatawebcontrol.md

latest3.1 KB
Original Source

ASPxDataWebControl.DataSourceID Property

Specifies the control’s data source ID.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public override string DataSourceID { get; set; }
vb
Public Overrides Property DataSourceID As String

Property Value

TypeDescription
String

The control’s ID.

|

Remarks

This property cannot be set by themes or style sheet themes.

Example

ASPxGridView:

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
DataSourceID="SqlDataSource1" KeyFieldName="ProductID" >
</dx:ASPxGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\nwind.mdb;Persist Security Info=True" 
    ProviderName="System.Data.OleDb" 
    SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice], [UnitsInStock] FROM [Products]">
</asp:SqlDataSource>

Online Demo

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataSourceID property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-bind-webchartcontrol-to-data/CS/Default.aspx.cs#L9

csharp
protected void Button1_Click(object sender, EventArgs e) {
    WebChartControl1.DataSourceID = "AccessDataSource1";
    WebChartControl1.SeriesDataMember = "Year";

asp-net-web-forms-bind-webchartcontrol-to-data/VB/Default.aspx.vb#L10

vb
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    WebChartControl1.DataSourceID = "AccessDataSource1"
    WebChartControl1.SeriesDataMember = "Year"

See Also

DataSource

ASPxDataWebControl Class

ASPxDataWebControl Members

DevExpress.Web Namespace