paging
allow paging 向右的按鈕 <
固定datagrind 1. DHTML
javascript 自己做捲軸 <DIV> ----------------------------------- 2. Frame 切兩個欄位 放在 2.1 卷軸事件 top.frame.location ------------------------------------------------- PageIndexChanged 如果頁碼設定為, enter into the void of dg_PageINdexChanged ***client端分頁 dg.currentPageIndex = e.NewPageIndex; Refresh();
Da.fill(ds); dg.databind(); ------------------------------------------------------ ***server端分頁 1.先把超聯結做出來 2.Dataset --> DataView (做處理 如排序) allowsoring = true 3.屬性產生器 csutomerID companName DESC, customerID orderby
只要expression有座可以做超連結
4. dg_SortCommand Response.write(e.SortExpression); 'da.fill(ds); 'filter 每個的state Dataviewrowstate 'DataView dv = new Dataview(sd.Tables[0],"customerID<'KDDAS'", DatviewrowState. 'ds.tables[0].Defaultview da.Fill(ds); '將現有ds填滿 DataView dv = new Dataview(sd.Tables[0]); '建立 dv.sort = e.sortExpression(); dg.DataSource = dv; dg.Databind(); -----------------------------------------------------
5. dg_sortCommand da.Selectcommand.commandText+="ORDER BY" + e.sortExpression(); da.Fill(ds); dg.DataBind(); 缺點 a-z ,1u0 ------------------------------------------------------------ 先把 e.sortExpression存到 Session["Sort"] = e.SortExpression; da.Selectcommand.commandText+="ORDER BY" + Session["Sort"]; dg.PageIndexChanged() { dg.CurrentPageIndex=e.NewPageIndex; refresh(); dg.DataSource=dv; dg.databind(); }
void Refresh() { da.Selectcommand.commandText+="ORDER BY" + Session["Sort"]; da.Fill(ds); dg.databind(); } 有兩個表:
---------------
|