Grid view text is displays in 2 lines

5 posts, 0 answers
  1. Sugu
    Sugu avatar
    4 posts
    Member since:
    Oct 2018

    Posted 24 Oct 2018 Link to this post

    We have used this Wraptext property & its not working, currently the text is showing in 2 lines in the gridview. I’ve shown the text binding process in Image 1. Image 2 displays, the actual gridview with the content.
    I need to display the text before the “vbcrlf” in the grid view Please check image1.
  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3816 posts

    Posted 25 Oct 2018 Link to this post

    Hello, Sugu, 

    According to the provided screenshot, it seems that the text wrapping works as expected. However, the row's height is not adjusted to show the whole content. You have two options:
    - Set the AutoSizeRows property to true. Thus, the rows' height will be automatically adjusted considering the content that needs to be displayed.
    - Set the TableElement.RowHeight property to a greater value than the default 20. Thus, you will obtain a bigger fixed height for the rows. But it is not guaranteed that the whole content will be visible because the applied RowHeight may not be enough for all cases.

    Feel free to use this approach which suits your requirement best.

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

    Regards,
    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.
  3. Sugu
    Sugu avatar
    4 posts
    Member since:
    Oct 2018

    Posted 25 Oct 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello, Dess

    Thank you for the suggested. :)

    The property which you have provided displays the full description on the gridlines, but I just need to display single line on the description as mentioned in the image4. Please check and do the needful.

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3816 posts

    Posted 26 Oct 2018 Link to this post

    Hello, Sugu, 

    The grid illustrated in image4.png doesn't seem to wrap the text in the cells. Only a single line is shown. I am not sure why do you set the WrapText property to true for all columns in this case. You can still wrap the text and decrease the RowHeight to a value that is enough just to display a single line text according to the font of the applied theme, e.g. set the RowHeight to 20px:
     
    public RadForm1()
    {
        InitializeComponent();
     
        foreach (GridViewColumn col in this.radGridView1.Columns)
        {
            col.WrapText = true;
        }
         this.radGridView1.TableElement.RowHeight = 20;
    }



    I hope this information helps.

    Regards,
    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.
  5. Sugu
    Sugu avatar
    4 posts
    Member since:
    Oct 2018

    Posted 27 Oct 2018 Link to this post

    Thank you for the suggested solution it works nicely. :)
Back to Top