C# Windows窗体C中的分页

C# Windows窗体C中的分页,c#,winforms,datatable,datasource,paging,C#,Winforms,Datatable,Datasource,Paging,我有一张叫a的桌子,有15行。我使用了分页概念,在初始加载时只显示5行。一旦用户单击next,它将显示另外5行。 现在我将选择任意一行或两行,从表“A”到表“B”。 现在,我需要在表B中实现相同的分页概念,即如果用户从表“A”中选择超过5行的任何内容,则应将显示限制为表“B”中的5行,并且用户应只能通过单击“下一步”按钮查看第6行 我尝试过各种可能的方法,但都没有成功 有人能帮我吗 通过选择一行并将其显示在表B中,我放置了用于从表a中选择一行的代码段 private void btnSele

我有一张叫a的桌子,有15行。我使用了分页概念,在初始加载时只显示5行。一旦用户单击next,它将显示另外5行。 现在我将选择任意一行或两行,从表“A”到表“B”。 现在,我需要在表B中实现相同的分页概念,即如果用户从表“A”中选择超过5行的任何内容,则应将显示限制为表“B”中的5行,并且用户应只能通过单击“下一步”按钮查看第6行

我尝试过各种可能的方法,但都没有成功 有人能帮我吗

通过选择一行并将其显示在表B中,我放置了用于从表a中选择一行的代码段

  private void btnSelect_Click(object sender, EventArgs e)
    {
        DataGridViewSelectedRowCollection selectedRows = dgvFormFieldsView.SelectedRows;
        dgvFormFieldsView.ClearSelection();

          if (selectedRows.Count == 0)
          {
            MessageBox.Show("No rows selected!", "PDF Perform Warning");
            return;
          }
          for (int i = selectedRows.Count - 1; i >= 0; i--)
          {
                string fieldLabel = null;
                string fieldType = null;
                string tabOrder = null;

                tabOrder = (string)selectedRows[i].Cells[0].Value;
                fieldLabel = (string)selectedRows[i].Cells[1].Value;
                fieldType = (string)selectedRows[i].Cells[2].Value;

                DataRow newRow = selectedFieldsTable.NewRow();
                newRow["Field Name"] = fieldLabel;
                newRow["Field Type"] = fieldType;

                if (!selectedFieldsTable.Rows.Contains(new System.Object[] { fieldType, fieldLabel }))
                {
                    selectedFieldsTable.Rows.Add(newRow);

                }
                else
                {
                    MessageBox.Show("Form Field :" + fieldLabel + " already selected", "PDF Perform Info");
                }
            }
            dgvSelectedFieldsView.DataSource = selectedFieldsTable;
            dgvSelectedFieldsView.ClearSelection();
            applyFormattingSelectedFieldsTable();

            foreach (DataGridViewRow row in dgvSelectedFieldsView.Rows)
            {
                row.Cells[2].Style.BackColor = fieldValueDefaultBackColor;
                row.Cells[2].Style.SelectionBackColor = fieldValueSelectionBackColor;
            }
            if (ConfigParams.mode == Mode.Extract || ConfigParams.mode == Mode.Compare)
                dgvSelectedFieldsView.Columns["Field Value"].ReadOnly = true;
    }
有人能帮我吗!! 谢谢