gridview
-
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false. I want to show "Read" and "Unread" for 0,1 respectively. How can I do??? plz..help...
-
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false. I want to show "Read" and "Unread" for 0,1 respectively. How can I do??? plz..help...
-
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false. I want to show "Read" and "Unread" for 0,1 respectively. How can I do??? plz..help...
Use the GridView RowDataBound Event Delegate to change the value of one cell.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Text = e.Row.Cells[0].Text == "0" ? "Unread" : "Read"; }
Happy Coding... -
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false. I want to show "Read" and "Unread" for 0,1 respectively. How can I do??? plz..help...