Free Trial Buy Now

NavBar - Client-Side Functionality

Platform
Platform
Windows
Linux
Mac OS
SQL Server
SQL Server
MSSQL Server
Oracle
InterBase
MySql
DB2
Sybase
Browser
Browser
Internet Explorer
Firefox
Opera
Safari
Netscape
Language
Language
C#
Visual Basic
Object Pascal
J#
C++
v
v

Description

This example demonstrates how to manipulate a navbar control programmatically on the client using our extended client-side functionality. The client-side programmatic interface is available if the EnableClientSideAPI property is set to true or if there is a handler assigned to any client-side event.

In this demo, each group or item of the navbar control is identified using its Name property. In order to obtain a specific navbar group or item by its name on the client, the GetGroupByName or GetItemByName method is used respectively. In this demo, the navbar's AutoCollapse mode is enabled which specifies that only one group can be expanded within the navbar at any point in time. In this mode, the SetActiveGroup method can be used to expand the desired group. (See JS code, the ChangeActiveGroup function)

A specific navbar item can be selected within each group via the SetSelectedItem method by passing it the required item. (See JS code, the ChangeSelectedItem function)

The GroupExpandedChanged function that is a handler of the navbar's ExpandedChanged event (see ASPX and JS code) demonstrates how to synchronize values of the dropdown editors with the expanded group and the group's selected item, if any.

In the ShowProperties function (see JS code), the active group and the item selected within the group are obtained with the help of the GetActiveGroup and GetSelectedItem methods; and information on the index and name properties of these groups and items is displayed.

The code of the ShowActiveItems function (see JS code) demonstrates the way in which you can traverse through all the items of a specified group.

Note that an individual client object can be referenced either directly by its ID (for instance, by using the following code: ASPxNavBar1.ExpandAll()) or by using the Get method of a common collection for our ASPx web controls (this can be useful when our web control is contained within a UserControl or MasterPage: that is when the resulting client ID is generated by a specific NamingContainer). The GetNavBar function (see JS code) demonstrates how to access a client navbar object by means of our control collection.

Version: v2012 vol 2.8
Experience the DevExpress Difference Today
Demos with source code are included with an installation of DevExpress controls for ASP.NET. Refer to the Demos and Sample Applications topic to learn more.
To download your free evaluation copy of our award-winning ASP.NET libraries, visit the Downloads page
All DevExpress ASP.NET Controls ship as part of DXperience ASP.NET, Enterprise, and Universal.
To obtain pricing information, visit the Pricing Options page or contact us via Email at info@devexpress.com
or by telephone at +1 (818) 844-3383 between 8:30am and 5pm Pacific Time.