I have databinded my gridview from a particular linq statement which populates certain values from a table.
I need to show a different name when the gridview populates
for eg. instead of saying true(which it says in the database ) I need it to say Active.
I cannot change the database.
protected void rgUsers_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[0].Text == "false")
{
e.Row.Cells[0].Text = "Inactive";
}
else
if (e.Row.Cells[0].Text == "true")
{
e.Row.Cells[0].Text = "Active";
}
}
}
}
}
I need to show a different name when the gridview populates
for eg. instead of saying true(which it says in the database ) I need it to say Active.
I cannot change the database.
protected void rgUsers_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[0].Text == "false")
{
e.Row.Cells[0].Text = "Inactive";
}
else
if (e.Row.Cells[0].Text == "true")
{
e.Row.Cells[0].Text = "Active";
}
}
}
}
}