We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wrap problem

Hi,

i want to wrap some text and it doenst work.

here's my code:

gridWeb.WebWorksheets[0].Cells[0, 0].Style.Wrap = true;

Tks

Hi,

When you want to wrap text in the cell, you have to expand row height and column width accordinly.

Please check the following code which works fine:

GridWeb1.WebWorksheets[0].Cells.SetRowHeight(4,new Unit("40pt"));

GridWeb1.WebWorksheets[0].Cells.SetColumnWidth(3,new Unit("110pt"));

GridWeb1.WebWorksheets[0].Cells["D5"].PutValue("What I like to say then.\nIt is the second line");

GridWeb1.WebWorksheets[0].Cells["D5"].Style.Wrap = true;

Thank you.

Sahi, tks for the fast answer.

I cannot do that, because the cells width and height are defined at excel sheet (i import an excel file to app).

Any workaround?

Hi,

Well, it does not matter, you may add these lines after importing the excel file to the gridweb.

i.e..,

GridWeb1.WebWorksheets.ImportExcelFile(fileName);

.

GridWeb1.WebWorksheets[0].Cells.SetRowHeight(4,new Unit("40pt"));

GridWeb1.WebWorksheets[0].Cells.SetColumnWidth(3,new Unit("110pt"));

GridWeb1.WebWorksheets[0].Cells["D5"].Style.Wrap = true;

Thank you.

works :)

tks