Posted on: 6/18/2015 9:02:26 PM | Views : 735

Hello, I am attempting to sort a web listview for the first time. What am I doing incorrect? I am getting error message:
Unable to cast object of type 'System.Web.UI.WebControls.ListViewItem' to type 'System.Web.UI.WebControls.ListViewDataItem'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.ListViewItem' to type 'System.Web.UI.WebControls.ListViewDataItem'. Source Error: Line 200: Line 201: ' Get all values in all columns Line 202: Dim dataitem As ListViewDataItem = CType(e.Item, ListViewDataItem) Line 203: Line 204: Dim lblddesc As Label = ListView_Occasional.Items(dataitem.DisplayIndex).FindControl("ddesc") My Markup b ...

Go to the complete details ...