aspnet-devexpress-dot-web-dot-aspxwebcontrol-ecdd55f0.md
Binds the data source to the invoked server control.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public override void DataBind()
Public Overrides Sub DataBind
<dx:ASPxTitleIndex ID="ASPxTitleIndex1" runat="server">
<!-- ... -->
</dx:ASPxTitleIndex>
protected void Page_Load(object sender, EventArgs e) {
string[] names = File.ReadAllLines(Server.MapPath("~/App_Data/customers.txt"), Encoding.Unicode);
ASPxTitleIndex1.DataSource = names;
ASPxTitleIndex1.DataBind();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim names As String() = File.ReadAllLines(Server.MapPath("~/App_Data/customers.txt"), Encoding.Unicode)
ASPxTitleIndex1.DataSource = names
ASPxTitleIndex1.DataBind()
End Sub
Note
Up to v2010 vol 2, the DataBind method also binds the data source to the control’s child controls.
The following code snippets (auto-collected from DevExpress Examples) contain references to the DataBind() method.
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.
if (!IsCallback && !IsPostBack) {
grid.DataBind();
}
asp-net-web-forms-create-responsive-web-app/CS/ResponsiveWebApplication/Article.aspx.cs#L9
TableOfContentsTreeView.DataBind();
TableOfContentsTreeView.ExpandAll();
asp-net-web-forms-grid-create-master-detail-grid-at-runtime/CS/MasterDetailGrids/Default.aspx.cs#L23
protected void Page_Load(object sender, EventArgs e) {
masterGrid.DataBind();
}
asp-net-web-forms-popup-use-one-popup-for-entire-application/CS/T501713/WebForm1.aspx.cs#L28
};
grid.DataBind();
}
Session.Clear();
Diagram.DataBind();
}
asp-net-web-forms-grid-move-selected-rows-between-grid-controls/VB/E2636/Default.aspx.vb#L46
Next rowValue
TargetGrid.DataBind()
End If
If Not IsCallback AndAlso Not IsPostBack Then
grid.DataBind()
End If
asp-net-web-forms-grid-create-master-detail-grid-at-runtime/VB/MasterDetailGrids/Default.aspx.vb#L25
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
masterGrid.DataBind()
End Sub
asp-net-web-forms-popup-use-one-popup-for-entire-application/VB/T501713/WebForm1.aspx.vb#L28
End Sub
grid.DataBind()
End Sub
Session.Clear()
Diagram.DataBind()
End Sub
See Also