You can easily do it inside
RowDataBound
Event of Grid. Use
FindControl
method to find the control from Gridview and change the value.
Below is one Sample Code where
Student
is a sample class and
Status
is a field
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Student s = (Student)e.Row.DataItem;
if (s.Status == 1)
{
e.Row.Cells[2].Text = "Yes"
}
else
{
e.Row.Cells[2].Text = "false"
}
}
}
Hope this will help !!