System.Windows.Forms.DataGridViewRowCollection.GetRowCount(System.Windows.Forms.DataGridViewElementStates)

Here are the examples of the csharp api class System.Windows.Forms.DataGridViewRowCollection.GetRowCount(System.Windows.Forms.DataGridViewElementStates) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

9 Examples 7

1. Example

View license
public void UpdateScroll()      // call if hide/unhide cells - no call back for this
        {
            int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
            vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingRowIndex, rows - 1, dgv.DisplayedRowCount(false));
        }

2. Example

View license
protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            int dgvcolumnheaderheight = 0;

            Rectangle area = ClientRectangle;
            area.X += InternalMargin.Left;
            area.Y += InternalMargin.Top;
            area.Width -= InternalMargin.Left + InternalMargin.Right;
            area.Height -= InternalMargin.Top + InternalMargin.Bottom;

            if (dgv != null)                       // during designing, you may get in a situation where this code runs but these are not attached.  Fail gracefully. otherwise VS crashes
            {
                dgv.Location = new Point(area.X + ((VerticalScrollBarDockRight) ? 0 : ScrollBarWidth), area.Y);
                dgv.Size = new Size(area.Width - ScrollBarWidth, area.Height);
                dgvcolumnheaderheight = dgv.ColumnHeadersHeight;
            }

            if (vsc != null)
            {
                vsc.Location = new Point(area.X + ((VerticalScrollBarDockRight) ? (area.Width - ScrollBarWidth) : 0), area.Y+dgvcolumnheaderheight);
                vsc.Size = new Size(ScrollBarWidth, area.Height - dgvcolumnheaderheight) ;
            }

            if ( dgv != null && vsc != null )
            {
                vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingRowIndex, dgv.Rows.GetRowCount(DataGridViewElementStates.Visible) - 1, dgv.DisplayedRowCount(false));
            }
        }

3. Example

View license
protected void DGVRowsAdded(Object sender, DataGridViewRowsAddedEventArgs e)
        {
            int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
            Debug.Assert(vsc != null, "No Scroll bar attached");
            //Console.WriteLine("Rows Added: first:" + dgv.FirstDisplayedScrollingRowIndex + " disp:" + dgv.DisplayedRowCount(false) + " rows" + rows + " Added " + e.RowCount);
            vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingRowIndex, rows - 1, dgv.DisplayedRowCount(false));
        }

4. Example

View license
protected void DGVRowsRemoved(Object sender, DataGridViewRowsRemovedEventArgs e)
        {
            int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
            Debug.Assert(vsc != null, "No Scroll bar attached");
            //Console.WriteLine("Rows Removed: first:" + dgv.FirstDisplayedScrollingRowIndex + " disp:" + dgv.DisplayedRowCount(false) + " rows" + rows +  " Removed " + e.RowCount);
            vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingRowIndex, rows - 1, dgv.DisplayedRowCount(false));
        }

5. Example

View license
protected void DGVScroll(Object sender, ScrollEventArgs e)
        {
            if (ignoredgvscroll == false)
            {
                int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
                Debug.Assert(vsc != null, "No Scroll bar attached");
                //Console.WriteLine("DGV Scroll: first:" + dgv.FirstDisplayedScrollingRowIndex + " disp:" + dgv.DisplayedRowCount(false) + " rows" + rows);
                vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingRowIndex, rows - 1, dgv.DisplayedRowCount(false));
            }
        }

6. Example

View license
protected virtual void OnScrollBarChanged(object sender, ScrollEventArgs e)
        {
            Debug.Assert(dgv != null, "No Data view attached");
            int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
            //Console.WriteLine("VSC Scroll: first:" + dgv.FirstDisplayedScrollingRowIndex + " disp:" + dgv.DisplayedRowCount(false) + " rows" + rows);
            SetFirstDisplayed(vsc.Value);
        }

7. Example

View license
protected virtual void DGVRowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (e.StateChanged.Equals(DataGridViewElementStates.Visible))
            {
                int rows = dgv.Rows.GetRowCount(DataGridViewElementStates.Visible);
                Debug.Assert(vsc != null, "No Scroll bar attached");
                vsc.SetValueMaximumLargeChange(dgv.FirstDisplayedScrollingColumnIndex, rows - 1, dgv.DisplayedRowCount(false));
            }
        }

8. Example

Project: tcp-gecko-dotnet
Source File: MemSearch.cs
View license
public void UpdateGridViewPage(bool ResizeGridView)
        {
            //int PageCount = resList./n ..... /n //View Source file for more details /n }

9. Example

Project: Ego-Engine-Modding
Source File: Form1.cs
View license
private void showHideDifferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
      /n ..... /n //View Source file for more details /n }