Hi all,
I'm trying to do sorting for my gridview. This is the error I got
Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'
for this line
gvDetail.DataSource = SortDataTable(Session("myTable"), False)
Please help.
Protected Sub gridView_Sorting(ByVal sender As Object, ByVal e As GridViewSortEventArgs)
GridViewSortExpression = e.SortExpression
Dim pageIndex As Integer = gvDetail.PageIndex
gvDetail.DataSource = SortDataTable(Session("myTable"), False)
gvDetail.DataBind()
gvDetail.PageIndex = pageIndex
End Sub
I'm trying to do sorting for my gridview. This is the error I got
Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'
for this line
gvDetail.DataSource = SortDataTable(Session("myTable"), False)
Please help.
Protected Sub gridView_Sorting(ByVal sender As Object, ByVal e As GridViewSortEventArgs)
GridViewSortExpression = e.SortExpression
Dim pageIndex As Integer = gvDetail.PageIndex
gvDetail.DataSource = SortDataTable(Session("myTable"), False)
gvDetail.DataBind()
gvDetail.PageIndex = pageIndex
End Sub