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

Newline problem in a cell of excel

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Minkyu Lee
Top achievements
Rank 1
Minkyu Lee asked on 07 Sep 2010, 09:01 AM
Hello,

Column

A

Column

               B

 

 

 

protected void RadGrid1_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e)
    {
        if (e.RowType == GridExportExcelMLRowType.HeaderRow)
        {
            for (int i = 0; i < e.Row.Cells.Count; i++)
            {
                e.Row.Cells[i].Data.DataItem = e.Row.Cells[i].Data.DataItem.ToString().Replace("<br />", "\r\n");
            }
        }
    }

The above grid has 2 columns which are 'Column<br />A' and 'Column<br />B'.

When I export data using excelml, I replace '<br />' with '\r\n'. However it is not working.

How can I insert new line?

Thank you.

Minkyu Lee.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Sep 2010, 10:10 AM
Hello,


Try adding table structure in HeaderTemplate to get the appearance (instead of adding br) and see whether it helps.


-Shinu.
Tags
Grid
Asked by
Minkyu Lee
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or