Back to Devexpress

NavigationFrame.QueryControl Event

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-navigationframe.md

latest2.8 KB
Original Source

NavigationFrame.QueryControl Event

Allows you to dynamically assign content to each NavigationPage in this NavigationFrame or NavigationPane.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Deferred Control Load Events")]
public event QueryControlEventHandler QueryControl
vb
<DXCategory("Deferred Control Load Events")>
Public Event QueryControl As QueryControlEventHandler

Event Data

The QueryControl event's data class is DevExpress.XtraBars.Navigation.QueryControlEventArgs.

Remarks

The QueryControl event fires whenever a blank NavigationPage has to be displayed. When handling this event, use the e.Page property to determine which page fired this event and the e.Control property to assign a content for this page. For instance, the following code illustrates an example.

csharp
private void navigationPane1_QueryControl(object sender, DevExpress.XtraBars.Navigation.QueryControlEventArgs e) {
    if (e.Page == myPage1) e.Control = new myXtraUserControl();
}
vb
Private Sub navigationPane1_QueryControl(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Navigation.QueryControlEventArgs)
    If e.Page = myPage1 Then
    e.Control = New myXtraUserControl()
    End If
End Sub

Dynamic page population in a navigation frame and navigation page is identical to populating documents that belong to the Application UI Manager component. See the Deferred Load topic to learn more.

When a page populated on the QueryControl event is deselected, the NavigationFrame.ControlReleasing event is raised.

See Also

NavigationFrame Class

NavigationFrame Members

DevExpress.XtraBars.Navigation Namespace