private void BindDropDownList() { List <tlkpConnect> connect = new List <tlkpConnect>(); foreach (var item in DataContext.NWODC.tlkpConnects) { var conOpt = CampaignConnect.Where(a => a.ConnectID == item.ID).SingleOrDefault(); if (conOpt == null) { connect.Add(item); } } if (connect.Count != 0) { ddlConnectionOption.DataSource = connect; ddlConnectionOption.DataTextField = "Name"; ddlConnectionOption.DataValueField = "ID"; ddlConnectionOption.DataBind(); pnlAddConnection.Visible = true; } else { pnlAddConnection.Visible = false; } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string linkID = e.CommandArgument.ToString(); if (e.CommandName == "Delete") { CampaignConnect = CampaignConnect.Where(a => a.ModifiedID.ToString() != linkID).ToList(); BindDropDownAndRepeater(); } }