private void btnOneLeft_Click(object sender, EventArgs e) { try { if (bsFileds.Count <= 0) { return; } DetailQueryFiled CurrField = bsFileds.Current as DetailQueryFiled; if (CurrField != null) { bsFileds.RemoveCurrent(); bsFileds.ResetBindings(false); } } catch (Exception ex) { MsgBox.ShowError(ex.Message); } }
private void btnOneRight_Click(object sender, EventArgs e) { try { string CurrCellValue = gvFiled.FocusedValue.ToString(); if (!string.IsNullOrEmpty(CurrCellValue)) { int count = (bsFileds.List as IList <DetailQueryFiled>).Where(P => P.FiledCode.EndsWith(CurrCellValue)).Count(); if (count == 0) { DetailQueryFiled filedInfo = new DetailQueryFiled(); filedInfo.FiledCode = CurrCellValue; filedInfo.FiledName = CurrCellValue; this.bsFileds.Add(filedInfo); bsFileds.ResetBindings(false); } } } catch (Exception ex) { MsgBox.ShowError(ex.Message); } }