DataGrid - Vertical Column Headings and Custom Cell Formatting

2 posts, 0 answers
  1. neil
    neil avatar
    9 posts
    Member since:
    Nov 2016

    Posted 30 Sep 2019 Link to this post


    I have a data grid and I am wondering if the column header text can be vertical ?  If so, how do you make the text vertical?

    Within the grid I have columns with Y and N, I want to make the background of the cell Green if Y and Red if N - what do I need to do to achieve this?



  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4125 posts

    Posted 01 Oct 2019 Link to this post

    Hello, Neil,    

    In order make the header text vertical, feel free to use the following code snippet: 

            public RadForm1()
                this.radGridView1.TableElement.TableHeaderHeight = 90; 
            private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
                GridHeaderCellElement element = sender as GridHeaderCellElement;
                if (element != null)
                    element.TextOrientation = Orientation.Vertical;
                    element.FlipText = true;

    As to the question about styling the cell considering the data value, it is appropriate to use the CellFormatting event. Please refer to the following help article demonstrating how to use it:

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top