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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ACTION OF CUSTOMIZATION TOOLBAR

Thread ID:

Created:

Updated:

Platform:

Replies:

143487 Mar 21,2019 09:43 PM UTC Mar 22,2019 06:47 AM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Guadalupe
Asked On March 21, 2019 09:43 PM UTC

Hello
I need  to example of a action of to button of customization toolbar in the moment that select to row.



Vignesh Natarajan [Syncfusion]
Replied On March 22, 2019 06:47 AM UTC

Hi Guadalupe, 
 
Thank for contacting Syncfusion support. 
 
Query: ACTION OF CUSTOMIZATION TOOLBAR 
 
We have achieved your requirement using custom toolbar feature of ejGrid. And using toolbarClick event we have changed the alignment of selected tr. 
 
Please refer the below code example, 
 
  <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True"> 
        <ClientSideEvents ToolbarClick="onToolBarClick" /> 
………………….. 
        <ToolbarSettings ShowToolbar="True"> 
            <CustomToolbarItem> 
                <ej:CustomToolbarItem Text="left" /> 
                <ej:CustomToolbarItem Text="center" /> 
                <ej:CustomToolbarItem Text="right" /> 
            </CustomToolbarItem> 
        </ToolbarSettings> 
        <Columns> 
…………………………… 
    </ej:Grid> 
 
 
    <script type="text/javascript"> 
        function onToolBarClick(sender) { 
            var gridObj = $("#<%= OrdersGrid.ClientID %>").data("ejGrid"); 
            var rowIndex = gridObj.model.selectedRowIndex; 
            var tr = gridObj.getRows()[rowIndex]; 
            if (sender.itemName == "left") 
                $(tr).find('td').css('cssText', 'text-align: left !important'); 
            else if (sender.itemName == "center") 
                $(tr).find('td').css('cssText', 'text-align: center !important'); 
            else 
                $(tr).find('td').css('cssText', 'text-align: right !important'); 
 
        } 
    </script> 
 
    <style type="text/css" class="cssStyles"> 
        .left { 
            background-image: url("../Content/left.png"); 
            background-size: 20px 20px; 
        } 
 
        .center { 
            background-image: url("../Content/center.png"); 
            background-size: 20px 20px; 
        } 
 
        .right { 
            background-image: url("../Content/right.png"); 
            background-size: 20px 20px; 
        } 
    </style> 
 
</asp:Content> 
 
 
Refer the below link for sample, 
 
 
Also refer the below link for help documentation and demo, 
 
 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;