c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?

c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?
事件语句
protected void GridView1_RowDataBound(object sender,GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[3].Text = Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString();
}
}

e.Row.RowType
DataControlRowType.DataRow又表示什么?
想飞的翅膀solo 1年前 已收到1个回答 举报

英宁宁 幼苗

共回答了13个问题采纳率:100% 举报

e.Row.RowType 是指当前行的类型
DataControlRowType 是GridView的行的类型集合 其中的DataRow是数据绑定行
这个判断语句的意思就是判断当前行是不是数据绑定行
是绑定时候用来过滤标题行和序号行等等非数据绑定行的
具体的可以在msdn上查找DataControlRowType 看

1年前

3
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.078 s. - webmaster@yulucn.com