原創(chuàng)|其它|編輯:郝浩|2012-11-14 11:35:30.000|閱讀 265 次
概述:在Spread ASP.NET中自定義頁(yè)面導(dǎo)航的注意事項(xiàng),附加源碼。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在一個(gè)工作表格中有大量數(shù)據(jù)的頁(yè)面,可以實(shí)現(xiàn)在同一時(shí)間顯示,這個(gè)和HTML頁(yè)面有所不同,當(dāng)一個(gè)工作表格包含了在組將中可以顯示的更多的行時(shí),Spread就會(huì)自動(dòng)的創(chuàng)建頁(yè)面,將行打組,這樣就可以在工作表格頁(yè)面之間進(jìn)行瀏覽了。例如:對(duì)于一個(gè)有50行的表格,你想要在同一時(shí)間顯示10行,那么每個(gè)頁(yè)面就會(huì)有10行。
你可以使用在組件邊緣的頁(yè)面導(dǎo)航按鈕來(lái)實(shí)現(xiàn),這些按鈕包括了下一步(有箭頭),以及上一頁(yè)(左箭頭)。你自己決定哪些按鈕將要通過組將來(lái)進(jìn)行顯示,以及在組件的什么位置上進(jìn)行顯示。自定義這些頁(yè)面導(dǎo)航是FpSpread 類的PagerInfo 類以及頁(yè)面屬性來(lái)完成。
你可以采用下面的方式來(lái)實(shí)現(xiàn)自定義頁(yè)面導(dǎo)航:
下圖展示了頁(yè)面導(dǎo)航按鈕各種選項(xiàng),采用的是默認(rèn)的字體以及對(duì)齊方式:
但是值得注意的是,你不能一次性的在所有的位置顯示頁(yè)面導(dǎo)航,但是你可以在頂部和底部或者是頂部和命令欄統(tǒng)一時(shí)間顯示。
下面我們來(lái)一起看一下一個(gè)具體的示例:
在這個(gè)例子中呢,將頁(yè)面導(dǎo)航的位置設(shè)置到了組件的頂部的位置,在一個(gè)獨(dú)立的共組欄里,同時(shí)顯示了頁(yè)面數(shù)量和頁(yè)面有指定的字體和顏色,放在了頂部的右端,如下所示:
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
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件