Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

HtmlContentControl.CustomFieldValue Event

Allows you to supply data to custom data fields.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.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