我有一个数据网格,最多可容纳 250 行,其中包含名为 Tab 顺序的 unquie 列。现在我只需要 5 行,剩下的行应该只有在我单击下一步按钮时才可见,依此类推..
下面是我的代码片段,当 for 循环完成时,它会将所有 250 行数据加载到数据网格中。我需要在这里实现分页概念,任何人都可以帮助指导我走上正确的道路
提前致谢
代码片段:
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 < 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); --> adds up data in data grid
formField++;
}
}
document.save(dummyPDFPath);
}