windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtokenedit-7d0872ce.md
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
[DXCategory("Events")]
public event TokenEditBeforeShowPopupPanelEventHandler BeforeShowPopupPanel
<DXCategory("Events")>
Public Event BeforeShowPopupPanel As TokenEditBeforeShowPopupPanelEventHandler
The BeforeShowPopupPanel event's data class is TokenEditBeforeShowPopupPanelEventArgs. The following properties provide information specific to this event:
| Property |
|---|
| DataObject |
| DataSourceIndex |
| Token |
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.
void TokenEdit1_BeforeShowPopupPanel(object sender, TokenEditBeforeShowPopupPanelEventArgs e) {
labelControl2.Text = e.Token.Description;
labelControl4.Text = (e.DataObject as DevExpress.DataAccess.Sql.DataApi.IRow)["ModifiedDate"].ToString();
}
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