Consider the following Class.Mind it that you have to bind the class in list view property.
EPromotion objPromotion =new EPromotion();
objPromotion.EmployeeId = Convert.ToInt64(employeeIdTextBox.Text);
objPromotion.EmployeeName = employeeNameTextBox.Text;
List<EPromotion> liPromotion = new List<EPromotion>();
liPromotion.Add(objPromotion);
objPromotion.listPromotion = liPromotion;
/******** ADD ******/
promotionlistView.Items.Add(objPromotion);
/*** Selected EDIT *****/
EPromotion selectedPromotion = (EPromotion)this.promotionlistView.SelectedItem;
/***** Selected remove *******/
promotionlistView.Items.RemoveAt(promotionlistView.Items.IndexOf(promotionlistView.SelectedItem));
EPromotion objPromotion =new EPromotion();
objPromotion.EmployeeId = Convert.ToInt64(employeeIdTextBox.Text);
objPromotion.EmployeeName = employeeNameTextBox.Text;
List<EPromotion> liPromotion = new List<EPromotion>();
liPromotion.Add(objPromotion);
objPromotion.listPromotion = liPromotion;
/******** ADD ******/
promotionlistView.Items.Add(objPromotion);
/*** Selected EDIT *****/
EPromotion selectedPromotion = (EPromotion)this.promotionlistView.SelectedItem;
/***** Selected remove *******/
promotionlistView.Items.RemoveAt(promotionlistView.Items.IndexOf(promotionlistView.SelectedItem));
Comments
Post a Comment