Back to Devexpress

RepositoryItemTokenEdit.BeforeShowPopupPanel Event

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtokenedit-7d0872ce.md

latest3.8 KB
Original Source

RepositoryItemTokenEdit.BeforeShowPopupPanel Event

Occurs before the peek panel assigned to this TokenEdit is displayed.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event TokenEditBeforeShowPopupPanelEventHandler BeforeShowPopupPanel
vb
<DXCategory("Events")>
Public Event BeforeShowPopupPanel As TokenEditBeforeShowPopupPanelEventHandler

Event Data

The BeforeShowPopupPanel event's data class is TokenEditBeforeShowPopupPanelEventArgs. The following properties provide information specific to this event:

Property
DataObject
DataSourceIndex
Token

Remarks

To assign a FlyoutPanel to your TokenEdit control, use the RepositoryItemTokenEdit.PopupPanel property. When a user moves the mouse pointer over a selected token, the BeforeShowPopupPanel event fires. Handle it to customize the flyout panel that is about to pop up.

Event arguments expose the following properties:

  • e.Token - the hovered token;
  • e.Value, e.Description - the value and description of the hovered token;
  • e.DataObject - in bound mode, returns an Object that is the data source record. In unbound mode, returns the hovered token as an Object.
  • e.DataSourceIndex - in bound mode, returns the index of a data source record. In unbound mode, returns the index of the hovered token within the RepositoryItemTokenEdit.Tokens collection.
  • e.Bounds - flyout panel bounds.

The code below populates two flyout panel labels with the token description and the value of the corresponding data source record’s “Modified Date” column.

csharp
void TokenEdit1_BeforeShowPopupPanel(object sender, TokenEditBeforeShowPopupPanelEventArgs e) {
    labelControl2.Text = e.Token.Description;
    labelControl4.Text = (e.DataObject as DevExpress.DataAccess.Sql.DataApi.IRow)["ModifiedDate"].ToString();
}
vb
Private Sub TokenEdit1_BeforeShowPopupPanel(ByVal sender As Object, ByVal e As TokenEditBeforeShowPopupPanelEventArgs)
    labelControl2.Text = e.Token.Description
    labelControl4.Text = (TryCast(e.DataObject, DevExpress.DataAccess.Sql.DataApi.IRow))("ModifiedDate").ToString()
End Sub

See Also

Token Edit Control

RepositoryItemTokenEdit Class

RepositoryItemTokenEdit Members

DevExpress.XtraEditors.Repository Namespace