Back to Devexpress

AccordionControlElementBase.Tag Property

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrolelementbase-d1d27793.md

latest4.1 KB
Original Source

AccordionControlElementBase.Tag Property

Gets or sets an object that contains custom data for the current element.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Data")]
public object Tag { get; set; }
vb
<DXCategory("Data")>
<DefaultValue(Nothing)>
Public Property Tag As Object

Property Value

TypeDefaultDescription
Objectnull

Custom data assigned to the element.

|

Remarks

You can use the Tag property to associate custom data with the element and then subsequently use this data. For instance, you can assign unique values to the Tag properties to identify certain elements while handling element-specific events.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Tag 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-generate-skin-palettes-with-ai/CS/DevExpress.AI.WinForms.AIGeneratePalette.Demo/AccordionShellForm.cs#L33

csharp
void InitNavigationItems() {
    employeeViewAccordionElement.Tag = employeeViewPage.Tag = typeof(Views.EmployeeView);
    dataGridViewPage.Tag = dataGridViewAccordionElement.Tag = typeof(Views.DataGridView);

create-winforms-accordion-control-in-code/CS/AccordionControl-ex/Form1.cs#L113

csharp
if (e.Element.Style == DevExpress.XtraBars.Navigation.ElementStyle.Group) return;
if (e.Element.Tag == null) return;
string itemID = e.Element.Tag.ToString();

winforms-dashboard-custom-items-extension/CS/CustomItemTest/DesignerForm1.cs#L50

csharp
item.Text = dashboardFile.Replace("Dashboards\\","").Replace(".xml","");
    item.Tag = dashboardFile;
}

create-winforms-accordion-control-in-code/VB/AccordionControl-ex/Form1.vb#L102

vb
If e.Element.Style = ElementStyle.Group Then Return
If e.Element.Tag Is Nothing Then Return
Dim itemID As String = e.Element.Tag.ToString()

winforms-dashboard-custom-items-extension/VB/CustomItemTest/DesignerForm1.vb#L51

vb
item.Text = dashboardFile.Replace("Dashboards\","").Replace(".xml","")
    item.Tag = dashboardFile
Next dashboardFile

See Also

AccordionControlElementBase Class

AccordionControlElementBase Members

DevExpress.XtraBars.Navigation Namespace