Skip to main content
All docs
V24.1

HtmlContentControl.CustomFieldValue Event

Allows you to supply data to custom data fields.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public event HtmlContentCustomFieldValueEventHandler CustomFieldValue

Event Data

The CustomFieldValue event's data class is DevExpress.XtraEditors.HtmlContentCustomFieldValueEventArgs.

Remarks

The following example handles the CustomFieldValue event to calculate a value for the FullName custom data field:

namespace DXApplication {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        DataItem dataContext;
        public Form1() {
            InitializeComponent();
            dataContext = new DataItem() { FirstName = "Max", LastName = "Fisher" };
            htmlContentControl1.DataContext = dataContext;
            htmlContentControl1.CustomFieldValue += HtmlContentControl1_CustomFieldValue;
        }
        void HtmlContentControl1_CustomFieldValue(object sender, DevExpress.XtraEditors.HtmlContentCustomFieldValueEventArgs e) {
            if (e.PropertyName == "FullName")
                e.Value = string.Format("{0} {1}", dataContext.FirstName, dataContext.LastName);
        }
    }
    public class DataItem {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}
See Also