原創|其它|編輯:郝浩|2012-11-14 11:35:30.000|閱讀 265 次
概述:在Spread ASP.NET中自定義頁面導航的注意事項,附加源碼。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在一個工作表格中有大量數據的頁面,可以實現在同一時間顯示,這個和HTML頁面有所不同,當一個工作表格包含了在組將中可以顯示的更多的行時,Spread就會自動的創建頁面,將行打組,這樣就可以在工作表格頁面之間進行瀏覽了。例如:對于一個有50行的表格,你想要在同一時間顯示10行,那么每個頁面就會有10行。
你可以使用在組件邊緣的頁面導航按鈕來實現,這些按鈕包括了下一步(有箭頭),以及上一頁(左箭頭)。你自己決定哪些按鈕將要通過組將來進行顯示,以及在組件的什么位置上進行顯示。自定義這些頁面導航是FpSpread 類的PagerInfo 類以及頁面屬性來完成。
你可以采用下面的方式來實現自定義頁面導航:
下圖展示了頁面導航按鈕各種選項,采用的是默認的字體以及對齊方式:
但是值得注意的是,你不能一次性的在所有的位置顯示頁面導航,但是你可以在頂部和底部或者是頂部和命令欄統一時間顯示。
下面我們來一起看一下一個具體的示例:
在這個例子中呢,將頁面導航的位置設置到了組件的頂部的位置,在一個獨立的共組欄里,同時顯示了頁面數量和頁面有指定的字體和顏色,放在了頂部的右端,如下所示:
C#
// Set the number of sheets. FpSpread1.Sheets.Count = 5; // Set the number of rows on the first sheet FpSpread1.Sheets[0].RowCount = 136;// Set the number of rows per page in this sheet. FpSpread1.Sheets[0].PageSize = 13; // Display the pager only at the top of the component. FpSpread1.Pager.Position = FarPoint.Web.Spread.PagerPosition.Top; // Display both numbers and arrows by setting mode. // Set the mode after the position, otherwise an error. FpSpread1.Pager.Mode = FarPoint.Web.Spread.PagerMode.Both; // Format the text in the pager at the top. FpSpread1.Pager.Align = HorizontalAlign.Right; FpSpread1.Pager.Font.Bold = true; FpSpread1.Pager.Font.Name = "Trebuchet MS"; FpSpread1.Pager.ForeColor = Color.Brown; FpSpread1.Pager.BackColor = Color.Orange; // Display at most four page numbers at a time. FpSpread1.Pager.PageCount = 4;
VB
' Set the number of sheets. FpSpread1.Sheets.Count = 5 ' Set the number of rows on the first sheet. FpSpread1.Sheets(0).RowCount = 136' Set the number of rows per page in this sheet. FpSpread1.Sheets(0).PageSize = 13 ' Display the pager only at the top of the component. FpSpread1.Pager.Position = FarPoint.Web.Spread.PagerPosition.Top ' Display both numbers and arrows by setting mode. ' Set the mode after the position, otherwise an error. FpSpread1.Pager.Mode = FarPoint.Web.Spread.PagerMode.Both ' Format the text in the pager at the top. FpSpread1.Pager.Align = HorizontalAlign.Right FpSpread1.Pager.Font.Bold = True FpSpread1.Pager.Font.Name = "Trebuchet MS" FpSpread1.Pager.ForeColor = Color.Brown FpSpread1.Pager.BackColor = Color.Orange ' Display at most four page numbers at a time. FpSpread1.Pager.PageCount = 4
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件