Ticket T951924
Visible to All Users

DataGrid - How to reorder toolbar items

created 4 years ago

Hi,

How can I change the position of the icon of the add/edit new row in the datagrid. e.g. in the codepen,
I want to arrange icon position from left to right like search panel, column chooser, refresh Icon, add new row, savechanges, discard changes. How can I achieve this?

Regards,
Mihit

Answers approved by DevExpress Support

created 4 years ago (modified 4 years ago)

Hello Mihit,

You can reorder your toolbar items as follows:

JavaScript
onToolbarPreparing: (e) => { var toolbarItems = e.toolbarOptions.items; var newToolbarItems = []; newToolbarItems.push( toolbarItems.find((item) => item.name === "searchPanel"), toolbarItems.find((item) => item.name === "columnChooserButton") ); // Add a refresh button newToolbarItems.push({ widget: "dxButton", location: "after", visible: true, options: { disabled: false, icon: "refresh", hint: "Refresh the Data", onClick: (eventData) => { console.log("Clicked"); } } }); newToolbarItems.push( toolbarItems.find((item) => item.name === "addRowButton"), toolbarItems.find((item) => item.name === "saveButton"), toolbarItems.find((item) => item.name === "revertButton") ); e.toolbarOptions.items = newToolbarItems; }

See this demo: CodePen.

P.S. Would you mind if I mark this ticket public so that other customers can find this solution?

Regards,
Romeo

    Comments (2)

      Thanks Romeo for the solution. Yes you can mark this ticket to public.

      DevExpress Support Team 4 years ago

        You are welcome!

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.