I have the following C# function:
public string CheckInCollection(long lngProvId)
{
//...
foreach (var item in collList)
{
strColl += item.Id.ToString() + " (" + item.Title + ")" + "\r\n";
}
return strColl;
}
The following C# function:
public void PopulateGridView(bool blType)
{
if (blType == false)
{
}
else
{
strCollFinalized = "" + ddlContent.SelectedItem + "|" + CheckInCollection(Convert.ToInt64(ddlContent.SelectedItem.Value)) + "";
string[] strL = strCollFinalized.Split('|');
DataTable dt = new DataTable();
DataColumn dc = new DataColumn("Provider");
DataColumn dc1 = new DataColumn("Collection");
dt.Columns.Add(dc);
dt.Columns.Add(dc1);
DataRow dr = dt.NewRow();
dr[dc] = strL[0];
dr[dc1] = strL[1];
dt.Rows.Add(dr);
gvData.DataSource = dt;
gvData.DataBind();
}
}
When the gridview is generated the second column is displayed in one line but when I check the source, it is displaying in the next line.
How can I modify so that the returned string shows each strColl
in a new line.
" instead of "\r\n" – techspider Jan 06 '16 at 20:38
` instead of translating into Html. – Si8 Jan 06 '16 at 20:40