无法将类型为“Rs_Sysyem.Models.RS_Person”的对象强制转换为类型“System.Data.DataRowView”。
protected void Attendance_gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton temp_edit = (ImageButton)e.Row.FindControl("lb_edit");
temp_edit.CommandName = "Attendance_Edit";
temp_edit.CommandArgument = e.Row.RowIndex.ToString();
Label temp_tab = (Label)e.Row.FindControl("a_status_m");
DataRowView temp_dv = (DataRowView)e.Row.DataItem;
temp_tab.Text = AttendanceClass.ShowStatus(temp_dv.Row["a_status_m"].ToString());
Label temp_tab_A = (Label)e.Row.FindControl("a_status_a");
DataRowView temp_dv_A = (DataRowView)e.Row.DataItem;
temp_tab_A.Text = AttendanceClass.ShowStatus(temp_dv_A.Row["a_status_a"].ToString()); } /////无法将类型为“Rs_Sysyem.Models.RS_Person”的对象强制转换为类型“System.Data.DataRowView”。
if (e.Row.RowType == DataControlRowType.Pager)
{
Label Templb = (Label)e.Row.FindControl("Recordcount_lb");
Templb.Text = _AttendanceManage.RecordCount;
Templb = (Label)e.Row.FindControl("Pagecount_lb");
Templb.Text = Attendance_gv.PageCount.ToString();
Templb = (Label)e.Row.FindControl("abbPage_lb");
Templb.Text = Convert.ToString(Attendance_gv.PageIndex + 1);
}
}