I must be overlooking something simple here. I have a listview control with an entitydatasource as it's data source. The Listview is used to insert, delete, edit and view the records. So far so good.
I want to be able to filter the records that are returned, and I'd like to do this in the code behind. So instead of setting the listview.datasourceID to the entitydatasource in the .aspx page, I want to bypass the entitydatasource altogether and set the listview.datasource in the code behind. But now I have a problem inserting and editing, and I'm assuming deleting. Appartently I now have to write the code in the ListView1_ItemInserting, ListView1_ItemUpdating and I'm assuming the ListView1_ItemDeleting events. Is this expected behavior?
Here's what I'm doing in the code behind:
Dim context As New WAPEntities
Dim tags = From t In context.MetaTags
Order By t.page
ListView1.DataSource = tags
View Complete Post