devexpress GridViewDataColumn 多行

devexpress GridViewDataColumn multiline

我在 asp.net 应用程序中使用了 devexpress Gridview。我需要将其中一个单元格数据显示为多行,例如:-

abcdefghijk
abcdefghijk
abcdefghijk

我尝试过使用 EncodeHtml="false" 方法,但它不起作用。

请提出一个好的选择。

我提议:

-用逗号分隔数据,如:abcdefghijk,abcdefghijk,abcdefghijk - 处理 HtmlDataCellPrepared 事件。

protected void ASPxGridViewInstance_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e) 
    {
        if (e.DataColumn.FieldName == FieldNameHere) 
        {
          if  (e.CellValue != null)
          {
                    string[] stringValues = e.CellValue.ToString().Split(',');
                    foreach (string item in stringValues)
                        e.Cell.Text += item + "<br />";
            }
        }
    }