We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to handle server-side ToolBarClick event?

Grid’s ToolBarClick event can be handled in Code Behind using server-sideOnServerToolBarClick” event property. The event handler receives an argument of type Syncfusion.JavaScript.Web.GridEventArgs containing data related to this event. The following Syncfusion.JavaScript.Web.GridEventArgs members provide information specific to this event.

Table 1: Syncfusion.JavaScript.Web.GridEventArgs members

Member

Description

itemName

It indicates current toolbar item’s name.

itemId

It indicates current toolbar id.

itemIndex

It returns the current index of toolbar item.

itemCurrentTarget

It returns the current item.

Gridmodel

It returns the grid model.

itemTarget

It returns the target item.

toolbarData

It returns the toolbar data.

Retrieve the Toolbar item value from server-side in ejGrid control:

The “OnServerToolBarClick” server-side event triggers the post back, once the toolbar item is clicked and maps to the corresponding event handler in Code Behind. In the server-side event handler, you can access the toolbar item values using the GridEventArgs e variable. Refer the following code examples.

ASPX

C#

Note: To trigger server-side events for EJ controls, you can add reference to ej.webform.min.js script file in site.master and add ScriptManager Control to the project.

ASPX

<link href="Content/ej/ej.widgets.core.min.css" rel="stylesheet" />

<link href="Content/ej/flat-lime/ej.theme.min.css" rel="stylesheet" />

<script src="Scripts/jquery-1.10.2.min.js"></script>

<script src="Scripts/jsviews.min.js"></script>

<script src="Scripts/jsrender.min.js"></script>

<script src="Scripts/jquery.easing-1.3.min.js"></script>

<script src="Scripts/jquery.globalize.min.js"></script>

<script src="Scripts/ej.web.all.min.js"></script>

<script src="Scripts/ej.webform.min.js"></script>

<body>

<form id="Form2" runat="server">

<asp:ScriptManager runat="server">

</asp:ScriptManager>

. . .

</form>

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
4473 04/17/2015 04/17/2015 ASP.NET Web Forms Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon