Back to Devexpress

DxHtmlElementEventArgs.ElementId Property

corelibraries-devexpress-dot-utils-dot-html-dot-dxhtmlelementeventargs.md

latest3.1 KB
Original Source

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

csharp
public string ElementId { get; }
vb
Public ReadOnly Property ElementId As String

Property Value

TypeDescription
String

The unique identifier of an HTML element.

|

Remarks

The code below illustrates how to identify elements and perform different actions for each.

html
<div class='buttonPanel'>
    
    
    
</div>
csharp
htmlContentControl.ElementMouseClick += (s, e) => {
    if(e.ElementId == "btnPhone")
        // Action #1
    if(e.ElementId == "btnVideo")
        // Action #2
    if(e.ElementId == "btnText")
        // Action #3
};
vb
AddHandler htmlContentControl.ElementMouseClick, Sub(s, e)
    If e.ElementId = "btnPhone" Then
        ' Action #1
    End If
    If e.ElementId = "btnVideo" Then
        ' Action #2
    End If
    If e.ElementId = "btnText" Then
        ' Action #3
    End If

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.

winforms-chat-for-net-framework/CS/DevExpress.AI.WinForms.HtmlChat/ChatControl.cs#L107

csharp
{
    if (e.ElementId == "btnSend")
    {

See Also

DxHtmlElementEventArgs Class

DxHtmlElementEventArgs Members

DevExpress.Utils.Html Namespace