我有一个列表框,它在选定的更改上运行一种将数据绑定到网格视图的方法。我收到错误消息:无法将 'System.EventArgs' 类型的对象转换为 'System.Web.UI.WebControls.GridViewRowEventArgs'。我的代码的其他部分从其他控件调用另一个 gridview.databind(),所以我不知道为什么它现在抛出这个错误?
Protected Sub lstEmployees_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lstEmployees.SelectedIndexChanged
Dim x As Int16
Dim startStr, endStr As String
If txtAdminSelectedDate.Text <> "" Then
dtWeeks = GetWeek(txtAdminSelectedDate.Text)
End If
If dtWeeks.Rows.Count > 0 Then
x = dtWeeks.Rows(0).Item(0).ToString().IndexOf("-")
endStr = dtWeeks.Rows(0).Item(0).ToString().Substring(x + 1, 11)
startStr = dtWeeks.Rows(0).Item(1).ToString()
dtWrkHours = GetHoursOfTheWeek(startStr, endStr, _user).Tables(0)
gvAdmin.DataSource = dtWrkHours
gvAdmin.DataBind()
sStatus = String.Empty
aStatus = String.Empty
AdminTot = 0
timeTot = 0
End If
End Sub