Home » ASP.NET » Sorting the ListView in ASP.NET

Sorting the ListView in ASP.NET

Are you confused about how to implement sorting in the new ListView control in ASP.NET 3.5?  Join me as I show you in this step by step video showing you exactly how to sort a ListView, even when it isn’t in gridview mode.


Other post in ASP.NET

Related Post

  • ListView and the DataPagerListView and the DataPager One of the new controls that Visual Studio 2008 brings us is the ListView.  Now, the ListView control is really several different controls all rolled into one.  There is a lot to see with […]
  • Validating A WebForms Checkbox . . .Validating A WebForms Checkbox . . . . . . and other ASP.NET controls that the Validation controls can not be wired to.The presentation today may be something you already know how to do.  But, this question comes up […]
  • Converting a DataList to a ListViewConverting a DataList to a ListView Yesterday, I spent the bulk of the day converting a DataList to a ListView.  I thought I'd spend a little time relating the process for those of you who might be interested in doing […]
  • Using Node.js and Gulp with ASP.NET in Visual Studio 2015Using Node.js and Gulp with ASP.NET in Visual Studio 2015 As I’ve written before, I’m using Angular a lot recently to write the client side of my web applications.  As I’ve gotten to the end of my current project, I found myself needing to […]
  • Simple Properties in C# 3.5Simple Properties in C# 3.5 It's such a little thing.  But, how much of our CSharp code looks something like this: private string _propertyName;public string PropertyName { get { […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer focusing on ASP.NET, C#, Node.js, JavaScript, HTML, CSS, BootStrap, and Angular.JS.Does your team need additional help in any of the above? Contact Dave today.

  • Alex Drimbe

    Hello, I did exactly like in your video but i recive the error:

    The ListView ‘listView’ raised event Sorting which wasn’t handled.
    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.InvalidOperationException: The ListView ‘listView’ raised event Sorting which wasn’t handled.

    If you have an explication I would apreciate it. Have a good day.

  • Dave

    Sorry, nothing comes to mind. But, let’s go through the obvious.
    1) You are using VS 2008
    2) You got the listView to display the content.
    3) You put the linkButton in the proper template section.

    If I had to guess, I’d say the last one is your problem. But, I’ve never seen this not work as described in the video, so I honestly can’t tell you what you might have done wrong without looking at your code.

    If you want, send me your code via the “Click Here to Ask a Question” link in the upper right hand corner and I’ll take a look.