Using Data Binding Events

  • 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.

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. You can also implement additional logic at this moment by providing a handler to the DataBound event.

The WindowDataBound event occurs immediately after an individual PopupWindow object has been automatically created and its properties have been initialized with values retrieved from corresponding data fields. You can add functionality to your application within a handler of the WindowDataBound event, by accessing the data bound window via the event argument's PopupWindowEventArgs.Window property, 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();

}

Concepts

Online demos