예제 #1
0
        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;
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
 void Table_ValueChanged(object sender, ValueChangedEventArgs e)
 {
     if (Rows.Contains(e.Row))
     {
         OnValueChanged(e);
     }
 }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 void HandleRowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
 {
     // Did the user remove LoadedRow?
     if (!Rows.Contains(LoadedRow))
     {
         LoadedRow = null;
     }
 }
예제 #6
0
 bool ICollection <IFeature> .Contains(IFeature item)
 {
     if (item is FeatureDataRow)
     {
         return(Rows.Contains(item.Oid));
     }
     throw new ArgumentException("item");
 }
예제 #7
0
 public virtual void RemoveRow(OrderRowEntity row)
 {
     if (Rows.Contains(row))
     {
         row.Synchronize = SynchronizeType.Deleted;
         RenumerableRows();
         RecalcTotals();
     }
 }
예제 #8
0
 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;
     }
 }
예제 #9
0
        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;
            }
        }
예제 #10
0
        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);
        }
예제 #11
0
        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];
            }
        }
예제 #12
0
 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);
             }
         }
     }
 }
예제 #13
0
 public bool Contains(TEntity entity)
 {
     return(Rows.Contains(entity));
 }
예제 #14
0
 public bool Contains(object item)
 {
     return(Rows.Contains(item));
 }
예제 #15
0
파일: GridRange.cs 프로젝트: skrutsick/RTVS
 public bool Contains(GridRange other)
 {
     return(Rows.Contains(other.Rows) && Columns.Contains(other.Columns));
 }
예제 #16
0
파일: GridRange.cs 프로젝트: skrutsick/RTVS
 public bool Contains(long row, long column)
 {
     return(Rows.Contains(row) && Columns.Contains(column));
 }
예제 #17
0
 public bool Contains(int row, int column)
 {
     return(Rows.Contains(row) && Columns.Contains(column));
 }