title: DataGrid Paging in C# (With Next & Previous Link )
body: <p>I have a Data Grid holding upto 250 rows with unquie column called Tab order. Now i need to 
  have only 5 rows and remaining rows should only be visbile when i click on next button and so on .. </p>
  
  <p>below is my code snippet, when the for loop is completed it will load up all 250 row data into data grid .. i need to implement paging concept here can any one help out in guiding me in right path </p>
  
  <p>Thanks in advance </p>
  
  <p>code snippet : </p>
  
  <pre><code>private void buttonUpload_Click(object sender, EventArgs e)
          {
              LoadFile(pdfFullPath, txtPassword.Text);
  
              form = document.getDocumentCatalog().getAcroForm();
              java.util.List FieldTypes = form.getFields();
  
              formFieldCount = FieldTypes.size();
              totalPages = document.getNumberOfPages();
  
              ///cmbpage --- Code pasted here 
              ArrayList lstPages = new ArrayList();
              ArrayList lstTabs = new ArrayList();
              ArrayList lstNames = new ArrayList();
              ArrayList lstTypes = new ArrayList();
  
              if (formFieldCount != 0)
              {
                 int formField = 1; 
                  for (int i = 0; i &lt; formFieldCount; i++)
                  {
                      pdfFields = (PDField)form.getFields().get(i);
                      fieldName = pdfFields.getFullyQualifiedName();
  
                      FieldType type = new FieldType();
                      if (pdfFields is PDTextbox)
                      {
                          type = FieldType.Text;
                          System.String iAsString = Integer.toString(formField);
                          pdfFields.setValue(iAsString);
  
                      }
  
                      else if (pdfFields is PDCheckbox)
                      {
                          type = FieldType.CheckBox;
                          System.String iAsString = Integer.toString(formField);
                          checkBoxList.Add(fieldName, formField);
                      }
                      else if (pdfFields is PDRadioCollection)
                      {
                          type = FieldType.RadioButton;
                          System.String iAsString = Integer.toString(formField);
                          radioButtonsList.Add(fieldName, formField);
                      }
                      else if (pdfFields is PDPushButton)
                      {
                          type = FieldType.PushButton;
                          System.String iAsString = Integer.toString(formField);
                      }
  
                          DataRow newRow = availableFieldsTable.NewRow();              
                          newRow["Field Type"] = type;
                          newRow["Tab Order"] = formField;
                          newRow["Field Name"] = fieldName;
  
                          availableFieldsTable.Rows.Add(newRow);  --&gt; adds up data in data grid                
                      formField++;
                  }
  
               }
  
              document.save(dummyPDFPath);
          }
  </code></pre>