排序datagrid表时出错

时间:2014-04-14 17:34:46

标签: asp.net vb.net

我在点击时尝试对datagrid列进行排序,最后我收到了以下错误消息:

System.IndexOutOfRangeException:找不到列ibsn。

该代码适用于其他列。不确定我哪里出错了。

Sub Sort_Grid(ByVal sender As Object, ByVal e As DataGridSortCommandEventArgs)
    if Session("MyCurrentSort") = e.SortExpression then
        Session("MyCurrentSort") = e.SortExpression & " desc"
    else
        Session("MyCurrentSort") = e.SortExpression
    end if
    BindGrid()
End Sub

0 个答案:

没有答案