I'm having trouble with something that should be very simple.
I can populate a listview with a linq to sql control using the wizard, but actually need to do a more complicated query, so I eventually gave up as it wasn't at all obvious how I could add my own customer query (other than the very basic select statements through the wizard).
So I went the alternative route and wrote a linq to sql query and set that as the datasource.
The problem I now have is that I'm struggling to get edit functionality working, as although I've managed to get a button control into the form, I can't get it to make the listview go into edit mode for the selected record.
I suppose my first query is, was I right to go the way of creating my own linq to sql query in the codebehind or should I have done it in the linq to sql datasource some how?
Secondly, I've got the following code, that should bring up a message box when the button is clicked but it does not, can anyone explain why?
Protected Sub ListView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewCommandEventArgs) Handles ListView1.ItemCommand
If e.CommandName = "Edit" Then
The code for the butto
View Complete Post