Thursday, March 3, 2011

WPF Delete Selected Item From Listview

we often need to delete item from Listview. You have to use context menu for perform delete operation. then on your delete event just write:



 private void ticketRemovebutton_Click(object sender, RoutedEventArgs e)  
 {  
    if (ticketlistView.SelectedItem != null)  
      {  
       ticketlistView.Items.RemoveAt(ticketlistView.Items.IndexOf(ticketlistView.SelectedItem));  
      }  
    else  
      {  
       MessageBox.Show("Please select item for remove from the list");  
      }  
 }  









Download the Latest Sample

Enjoy....!!

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...