DxHtmlElementEventArgs.ElementId Property
Returns the unique identifier of an HTML element. Element IDs are set in HTML markup (the “id” property). See any “HtmlElementMouse~” event description for more information (for example, WinExplorerView.HtmlElementMouseClick).
Namespace: DevExpress.Utils.Html
Assembly: DevExpress.Data.Desktop.v25.2.dll
NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
Declaration
Property Value
| Type | Description |
|---|---|
| String | The unique identifier of an HTML element. |
Remarks
The code below illustrates how to identify elements and perform different actions for each.
<div class='buttonPanel'>
<img id="btnPhone" src="PhoneCall"/>
<img id="btnVideo" src="VideoCall"/>
<img id="btnText" src="Message"/>
</div>
htmlContentControl.ElementMouseClick += (s, e) => {
if(e.ElementId == "btnPhone")
// Action #1
if(e.ElementId == "btnVideo")
// Action #2
if(e.ElementId == "btnText")
// Action #3
};
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ElementId property.
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.