protected void MyGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType != DataControlRowType.DataRow)
{
return;
}
Label a = (Label)e.Row.FindControl("aCount");
Label b = (Label)e.Row.FindControl("bCount");
Label d = (Label)e.Row.FindControl("dCount");
int ac = (int) ((DataRowView) e.Row.DataItem)["ACount"];
int bc = (int) ((DataRowView) e.Row.DataItem)["BCount"];
int dc = (int) ((DataRowView) e.Row.DataItem)["DCount"];
a.Text = ac < 0 ? "S" : "D";
b.Text = bc < 0 ? "S" : "D";
d.Text = dc < 0 ? "S" : "D";
}
2011年4月7日 星期四
MyGrid_RowDataBound
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言