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

Multi-line

2 Answers 60 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
Veteran
James asked on 23 Nov 2018, 11:41 PM

How could I display multi-line (i.e. the text has a carriage return in it).

 

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Nov 2018, 08:50 AM
Hello, James, 

By default, when the text is multi line in RadVirtualGrid, it is displayed properly. However, the row's height should be increased in order to show the whole content: 

public RadForm1()
{
    InitializeComponent();
    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.RowCount = 100;
    this.radVirtualGrid1.CellValueNeeded += radVirtualGrid1_CellValueNeeded;
    this.radVirtualGrid1.TableElement.RowHeight = 50;
    this.radVirtualGrid1.TableElement.HeaderRowHeight = 50;
}
 
private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = "Data" + e.RowIndex + "" + e.ColumnIndex + "\r\nSecond line" + Environment.NewLine + "Third";
}



I have also attached my sample project for your reference. If you are experiencing any further difficulties, could you please specify the exact steps how to reproduce the problem? Thus, we would be able to investigate the precise case and assist you further. Thank you in advance. 

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
James
Top achievements
Rank 1
Veteran
answered on 26 Nov 2018, 02:05 PM

Thanks for your help Dess.

I just need to replace the ascii 10 (carriage return) with the escaped newline.

I must have missed that.

Tags
VirtualGrid
Asked by
James
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
James
Top achievements
Rank 1
Veteran
Share this question
or