コード例 #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
ファイル: RowListBinder.cs プロジェクト: zeroxist/Libraries
 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
ファイル: PVDataViewer.cs プロジェクト: henanMayueyue/ProView
 void HandleRowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
 {
     // Did the user remove LoadedRow?
     if (!Rows.Contains(LoadedRow))
     {
         LoadedRow = null;
     }
 }
コード例 #6
0
ファイル: FeatureDataTable.cs プロジェクト: cugkgq/Project
 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));
 }