Multi-line

3 posts, 0 answers
  1. James
    James avatar
    21 posts
    Member since:
    Nov 2017

    Posted 23 Nov 2018 Link to this post

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

     

    Thanks in advance.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 26 Nov 2018 Link to this post

    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.
  3. James
    James avatar
    21 posts
    Member since:
    Nov 2017

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

    Thanks for your help Dess.

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

    I must have missed that.

Back to Top