All docs
V21.2
21.2
21.1
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

SvgImageItem.Id Property

Gets or sets the item’s unique identifier. The SVG image format allows IDs to be assigned to items via the id attribute.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.Utils.v21.2.dll

Declaration

public string Id { get; set; }

Property Value

Type Description
String

The item’s ID.

Remarks

The SVG format defines the optional id attribute to assign unique names to image elements.

<g id="seat_82">
    <g id="background_normal_82">

The SvgImageItem.Id property allows you to obtain this attribute’s value and assign a custom ID.

If the id attribute is missing, the Id property returns null.

The image designer shows items’ IDs in angle brackets and in the Property Grid (when you select a specific item).

image

If you assign a non-unique value to the Id property, the control raises an exception (DevExpress.XtraEditors.InvalidIdentifierException).

Note

The SVG format specification allows elements to be re-used via the “use” element. The use element references another element and indicates that the graphical contents of that element are included at that given point. Instead of an element defined with the use attribute, the SVGImageBox control creates a group which encapsulates the referenced element. The Ids of this element and all its children are set to null to avoid duplicate IDs.

Example

The following code searches for items whose IDs start with the “background_pressed” sub-string and then hides these items.

var items = svgImageBox1.FindItems(item => item.Id != null && item.Id.StartsWith("background_pressed"));
items.ForEach(item => item.Visible = false);
See Also