Ticket T297315
Visible to All Users

How to change a grid item apprearance in web

created 10 years ago

Hi,
I have for WEB this event ?! (I use in the windows… and doesn't found for web!!)

AddHandler dash.DashboardItemControlUpdated, AddressOf dash_updated

thanks!!

Comments (1)

    (because I change the forecolor, font and alignment in this event for windows…
    And need change in the web too!)
    thanks

    Answers approved by DevExpress Support

    created 10 years ago

    In the web viewer handle the ASPxClientDashboardViewer.ItemWidgetCreated Event to configure items settings. Refer to the T197575: How to access API of underlying widgets in the Web Viewer example demonstrating this approach.

      Show previous comments (15)
      JB JB
      Jonathan Barksdale 9 years ago

        One other bit of clarification regarding this question.  I created my grid through the Dashboard Designer and not in code;  therefore, I didn't assign a class to the header row, or the grid itself.  The system is generating those on the server side.  That's why I have questions concerning the DOM selection.  Thanks.

        JB JB
        Jonathan Barksdale 9 years ago

          Here is the code that I am using in an attempt to set the header row to bold.  It's not working (the center styling works, but not the bold setting):

          if (e.ItemName == "gridDashboardItem1")
                      {
                          var grid = e.GetWidget();
                          var gridOptions = grid.option();
                          grid.element().find(".dx-header-row").css("font-weight", "bold");
                          for(var i = 0; i < grid.columnCount(); i++)
                          {
                              grid.columnOption(i, 'alignment', 'center');
                          }

          }

          *** Please note that if I take away the grid.element.find() selector option and simply set the font-weight setting as grid.element().css("font-weight", "bold") then the boldness is applied, but to ALL rows!  I only need it applied to my header row, which is why I am attempting this with the find option.

          DevExpress Support Team 9 years ago

            The problem appears because grid content is not initialized at the moment. If you want to apply bold color to all headers you can define the following style on you page:

            CSS
            .dx-header-row { font-weight: bold; }

            Please check this solution and let me know whether or not it meets your requirements.

            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.