Skip to main content

Using Data Binding Events in Popup Control

  • 2 minutes to read

ASPxPopupControl implements specific data-binding events - ASPxDataWebControlBase.DataBound and ASPxPopupControl.WindowDataBound. They allow you to perform custom operations at specific times in the data binding process.

Run Demo: ASPxPopupControl - Data Binding

The DataBound event is invoked to notify you that any data-binding logic used by ASPxPopupControl has completed. This event occurs after all data items of a specified data source have been processed and the corresponding PopupWindow objects have been added. To implement additional logic at this time, add a handler to the DataBound event.

The WindowDataBound event occurs immediately after an individual PopupWindow object is automatically created and its properties have been initialized with values retrieved from corresponding data fields. To add functionality to your application within a handler of the WindowDataBound event, use the event argument’s PopupWindowEventArgs.Window property to access the data-bound window, and modify its settings as required.

The following example demonstrates how you can handle the WindowDataBound event, to bind the PopupWindow’s FooterText property to the Suite attribute manually

The image below shows the result.

ASPxPopupControl - WindowDataBound

protected void ASPxPopupControl1_WindowDataBound(object source, DevExpress.Web.PopupWindowEventArgs e) {
        e.Window.FooterText = DataBinder.Eval(e.Window.DataItem, "Suite").ToString();

}