Skip to main content

ASPxNavBar.ItemClick Event

Fires after an item has been clicked.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll


public event NavBarItemEventHandler ItemClick

Event Data

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

Property Description
Item Gets an item object related to the event.


Write an ItemClick event handler to perform specific actions on the server side each time an item is clicked within the navbar control. Note that this event fires immediately after the left mouse button is released. If the button is released when the mouse pointer is not over an item, the event doesn’t fire. You can use the event parameter’s property to identify the clicked item.


The server ItemClick event is not generated for items whose NavBarItem.NavigateUrl property’s value is defined.


This example demonstrates how the server ItemClick event can be handled for an ASPxNavBar control. Note that if this event is handled, it is invoked regardless of the control’s AutoPostBack property setting.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxNavBar" 
TagPrefix="dxnb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<script runat="server">
     protected void Page_Load(object sender, EventArgs e) {

     protected void ASPxNavBar1_ItemClick(object source, 
          DevExpress.Web.NavBarItemEventArgs e) {
         e.Item.Text += " is clicked";
         e.Item.Enabled = false;

<html xmlns="" >
 <head id="Head1" runat="server">
     <title>Enchancement for Server-Side ItemClick</title>
     <form id="form1" runat="server">
         <dxnb:ASPxNavBar ID="ASPxNavBar1" runat="server" AllowExpanding="False" 
        ShowExpandButtons="False" OnItemClick="ASPxNavBar1_ItemClick">
             <Paddings Padding="0px" />
                 <dxnb:NavBarGroup Text="Click on the item">
                         <dxnb:NavBarItem Text="Item1" />
                         <dxnb:NavBarItem Text="Item2" />
See Also