我有一個GridView,並在其中一列顯示名稱列表。 這個列表可能會變長,所以它會導致GridView變得很長,並且會切斷名稱。然後我必須去網格的底部並滾動。使字符串移動到GridView上的下一行
有沒有把休息到Grid打完5名就會使名稱到下一行的方法嗎?該行來自於concats所有的名字轉換成字符串一些SQL代碼:
爲GridView的(SELECT CAST(group_concat(CONCAT(cc.username)separator ',') AS CHAR(200)) FROM message
代碼:
public static GridView BuildUserChatsGrid()
{
GridView NewDg = new GridView();
NewDg.DataKeyNames = new string[] { "ID" };
NewDg.AutoGenerateColumns = false;
NewDg.CssClass = "tblResults draggable";
NewDg.HeaderStyle.CssClass = "tblResultsHeader";
NewDg.AlternatingRowStyle.CssClass = "ResultsStyleAlt";
NewDg.RowStyle.CssClass = "ResultsStyle";
NewDg.RowDataBound += ChatsGridDataBound;
NewDg.Columns.Add(new BoundField { DataField = "SentDate", HeaderText = "Date/Time" });
NewDg.Columns.Add(new BoundField { DataField = "MembersIncluded", HeaderText = "Members Included" });
NewDg.Width = Unit.Percentage(100.00);
return NewDg;
}
有一個名爲'TextWrapping =「WrapWithOverflow」的屬性,可以讓你控制 –