I am using a varchar(max) in a column of datatable. I am then populating my datagridview with the query.
Everything is going fine getting the data to the dgv. The problem is my crlf are not displaying correctly in the datagridview.
It is displaying all as one line of text.
For example:
Starting GetWebsiteSettings.
Starting GetTokenShowHideSettings.
End GetTokenShowHideSettings.
End GetWebsiteSettings.
Is displaying as
Starting GetWebsiteSettings.Starting GetTokenShowHideSettings.End GetTokenShowHideSettings.End GetWebsiteSettings.
This is how I am populating the dgv:
private void button_Search_Click(object sender, EventArgs e)
{
using (var model = new SuburbanPortalEntities())
{
var qry = from logs in model.Logs
select logs;
Guid corpid;
if (Guid.TryParse(textBox_CorporationGuid.Text, out corpid))
{
qry = qry.Where(x => x.CorporationId == corpid);
}
Guid tokenid;
if (Guid.TryParse(textBox_TokenId.Text, out tokenid))
{
qry = qry.Where(x => x.TokenId == tokenid);
}
if (checkBox_DisplayErrors.Checked)
{
qry = qry.Where(x => x.IsException);
}
if (checkBox_DisplayWarnings.Checked)
{
qry = qry.Where(x => x.IsWarning);
}
qry = qry.OrderBy(x => x.LogDateTime);
dataGridView1.DataSource = qry;
dataGridView1.Columns["LogId"].Visible = false;
dataGridView1.Columns["ClientHeaders"].Visible = false;
dataGridView1.Columns["SourceId"].Visible = false;
}
}
How do I get the datagridview to display the text correctly?