Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

2011年4月7日 星期四

MyGrid_RowDataBound


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"; }

沒有留言:

張貼留言