I have a ListView that is bound to an ObjectDataSource. I want to create a new insert item when the user clicks on a button on the form. I do this by reacting to the button click event on the postback. In the button click event, I set ListView.InsertItemPosition = InsertItemPosition.FirstItem.
protected void NewButton_Click(object sender, EventArgs e)
// This line causes the ListView's ObjectDataSource to call its SelectMethod
// Removing this line, the SelectMethod is NOT called.
itemsListView.InsertItemPosition = InsertItemPosition.FirstItem;
This works, but for some reason the ObjectDataSource's SelectMethod is executed again.
Is there a reason why the SelectMethod of the ObjectDataSource is being called when the ListView's InsertItemPosition is set from None to FirstItem?
View Complete Post