This is a migrated thread and some comments may be shown as answers.

Grid view text is displays in 2 lines

4 Answers 196 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sugu
Top achievements
Rank 1
Sugu asked on 24 Oct 2018, 01:35 PM
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.

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Oct 2018, 08:04 AM
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.
0
Sugu
Top achievements
Rank 1
answered on 25 Oct 2018, 03:24 PM

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 line on the description as mentioned in the image4. Please check and do the needful.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Oct 2018, 11:19 AM
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.
0
Sugu
Top achievements
Rank 1
answered on 27 Oct 2018, 06:19 AM
Thank you for the suggested solution it works nicely. :)
Tags
GridView
Asked by
Sugu
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Sugu
Top achievements
Rank 1
Share this question
or