public void RemoveRow(double row) { if (Rows.Contains(row)) { var newCells = new GridCell <Two2DGridCellInfo> [Cells.GetLength(0), Cells.GetLength(1) - 1]; var index = Rows.IndexOf(row); //remove column Rows.Remove(row); for (int col = 0; col < Columns.Count; col++) { for (int r = 0; r < Rows.Count; r++) { if (r < index) { newCells[col, r] = Cells[col, r]; } else if (r == index && index > 0) { newCells[col, r] = Cells[col, r + 1]; newCells[col, r].Connect(newCells[col, r - 1], GridDirection.Front); } else { newCells[col, r] = Cells[col, r + 1]; } } } Cells = newCells; } }
public void DrawRow(CheckableDataGridViewRow gvRow) { SuspendLayout(); try { CheckableDataGridViewRow row = gvRow; if (Rows.Contains(row)) { Rows.Remove(row); } row.Cells.Clear(); DataGridViewCheckBoxCell cbCell = new DataGridViewCheckBoxCell { Value = gvRow.Checked }; row.Cells.Add(cbCell); foreach (object cellValue in gvRow.CellText) { DataGridViewCellStyle style = row.Disabled ? RowStyle(true) : UpdatingRowStyle(row.CellDataLoaded); row.Cells.Add(GetCell(style, cellValue)); } Rows.Add(row); } finally { ResumeLayout(); } }
void Table_ValueChanged(object sender, ValueChangedEventArgs e) { if (Rows.Contains(e.Row)) { OnValueChanged(e); } }
public void Search() { int j = tree1.SelectedIndex; if (j == -1) { j = 0; } for (int i = 0; i < AllTreeNodes.Count; i++) { if (j < AllTreeNodes.Count - 1) { j++; } else { j = 0; } string name = ""; if (SearchCol == 1) { name = AllTreeNodes[j].Field1; } else if (SearchCol == 2) { name = AllTreeNodes[j].Field2; } else if (SearchCol == 3) { name = AllTreeNodes[j].Field3; } else if (SearchCol == 4) { name = AllTreeNodes[j].Field4; } else if (SearchCol == 4) { name = AllTreeNodes[j].Field5; } if ((SearchCol == 0 && ((AllTreeNodes[j].Field1 != null && AllTreeNodes[j].Field1.ToLower().Contains(SearchText.ToLower())) || (AllTreeNodes[j].Field2 != null && AllTreeNodes[j].Field2.ToLower().Contains(SearchText.ToLower())) || (AllTreeNodes[j].Field3 != null && AllTreeNodes[j].Field3.ToLower().Contains(SearchText.ToLower())) || (AllTreeNodes[j].Field4 != null && AllTreeNodes[j].Field4.ToLower().Contains(SearchText.ToLower())) || (AllTreeNodes[j].Field5 != null && AllTreeNodes[j].Field5.ToLower().Contains(SearchText.ToLower())) )) || name.ToLower().Contains(SearchText.ToLower())) { if (!Rows.Contains(AllTreeNodes[j])) { collapsedParents.Clear(); SetVisible(AllTreeNodes[j]); } tree1.SelectedItem = AllTreeNodes[j]; tree1.ScrollIntoView(AllTreeNodes[j]); return; } } }
void HandleRowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e) { // Did the user remove LoadedRow? if (!Rows.Contains(LoadedRow)) { LoadedRow = null; } }
bool ICollection <IFeature> .Contains(IFeature item) { if (item is FeatureDataRow) { return(Rows.Contains(item.Oid)); } throw new ArgumentException("item"); }
public virtual void RemoveRow(OrderRowEntity row) { if (Rows.Contains(row)) { row.Synchronize = SynchronizeType.Deleted; RenumerableRows(); RecalcTotals(); } }
public void AddRow(WTPRow Row) { if (!Rows.Contains(Row)) { Rows.Add(Row); CorrectDiscName(Row.DataRow.STUDDISCIPLINE_NAME); CorrectDiscIndex(Row.DataRow.WTPROW_INDEX); CorrectSortIndex(Row.DataRow.WTPROW_SORTINDEX); Row.Variation = this; } }
public void RemoveRow(WTPRow Row) { if (Rows.Contains(Row)) { Rows.Remove(Row); VariationName = Rows.Where(dd => !dd.Deleted && !dd.Disposed) .Min(d => d.DataRow.STUDDISCIPLINE_NAME); VariationIndex = Rows.Where(dd => !dd.Deleted && !dd.Disposed) .Min(d => d.DataRow.WTPROW_INDEX); VariationSortIndex = Rows.Where(dd => !dd.Deleted && !dd.Disposed) .Min(d => d.DataRow.WTPROW_SORTINDEX); Row.Variation = null; } }
public void DeleteRow(DataGridViewRow value) { if (value == null) { throw new ArgumentNullException(nameof(value), Resources.NullParameterErrorMessage); } if (value.IsNewRow) { return; } value.Visible = false; if (Rows.Contains(value)) { Rows.Remove(value); } DeletedRows.Add(value); }
public void AddRow(TRow row) { if (Rows.Contains(row)) { return; } Rows.Add(row); if (Values.Length > Rows.Count) { return; } var copy = Values; Values = new TValue[copy.Length * 2][]; for (var i = 0; i < copy.Length; i++) { Values[i] = copy[i]; } }
void SetVisible(TreeNode Tn) { collapsedParents.Insert(0, Tn); if (Tn.Parent != null) { if (!Rows.Contains(Tn.Parent)) { SetVisible(Tn.Parent); } else { if (!Tn.Parent.IsExpanded) { SetIsExpanded(Tn.Parent, true); } for (int i = 0; i < collapsedParents.Count(); i++) { if (!collapsedParents[i].IsExpanded) { SetIsExpanded(collapsedParents[i], true); } } } } else { SetIsExpanded(Root, true); for (int i = 0; i < collapsedParents.Count(); i++) { if (!collapsedParents[i].IsExpanded) { SetIsExpanded(collapsedParents[i], true); } } } }
public bool Contains(TEntity entity) { return(Rows.Contains(entity)); }
public bool Contains(object item) { return(Rows.Contains(item)); }
public bool Contains(GridRange other) { return(Rows.Contains(other.Rows) && Columns.Contains(other.Columns)); }
public bool Contains(long row, long column) { return(Rows.Contains(row) && Columns.Contains(column)); }
public bool Contains(int row, int column) { return(Rows.Contains(row) && Columns.Contains(column)); }