日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Dev控件用法 aspxTreeList 无刷新 aspxGridView 数据

發(fā)布時(shí)間:2025/3/21 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Dev控件用法 aspxTreeList 无刷新 aspxGridView 数据 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Dev控件用法 aspxTreeList 無(wú)刷新 aspxGridView 數(shù)據(jù)

主要是利用 ASPxTreeList 點(diǎn)擊事件回發(fā)服務(wù)器進(jìn)行數(shù)據(jù)重新綁定

?

ASPxTreeList:

?
1 2 <SettingsBehavior ExpandCollapseAction="NodeDblClick"AllowFocusedNode="True"AllowSort="False"/> <ClientSideEvents? FocusedNodeChanged="function(s, e) { onFocusChanged(s,e);}"????Init="function(s, e) { }"/>

?

js代碼如下:

?
1 2 3 4 5 6 7 8 9 if($("ASPxTreeList1") !=?null) { ????????if(ASPxTreeList1.GetFocusedNodeKey !=?null|| ASPxTreeList1.GetFocusedNodeKey != undefined) { ?????????????key = ASPxTreeList1.GetFocusedNodeKey(); ????????} ????} ??? ASPxTreeList1.PerformCustomDataCallback(key);??//數(shù)據(jù)傳輸回調(diào)方法? ??? ASPxTreeList1.PerformCustomCallback(key);??//數(shù)據(jù)綁定回調(diào)方法

?

ASPxGridView?

?
1 oncustomcallback="ASPxGridView1_CustomCallback"

?

js中的performcallback方法捎帶的參數(shù)來(lái)進(jìn)行aspxgridview數(shù)據(jù)更新,通過(guò)aspxgridview的customcallback來(lái)實(shí)現(xiàn)

js代碼如下:

?
1 2 3 4 5 6 7 8 9 10 11 12 function onFocusChanged(s,e) { ????varkey =?""; ????if($("ASPxTreeList1") !=?null) { ????????if(ASPxTreeList1.GetFocusedNodeKey !=?null|| ASPxTreeList1.GetFocusedNodeKey != undefined) { ????????????key = ASPxTreeList1.GetFocusedNodeKey(); ????????} ????} ????ASPxGridView1.PerformDataCallback(key);??//數(shù)據(jù)傳輸回調(diào)方法? ???  ASPxGridView1.PerformCallback(key);??//數(shù)據(jù)綁定回調(diào)方法? ??? }

?

C#回調(diào)方法:

?

?
1 2 3 4 5 6 7 8 9 10 11 12 protectedvoidASPxGridView1_CustomCallback(objectsender, ASPxGridViewCustomCallbackEventArgs e) { ???????stringparm = e.Parameters.Trim();?//有的時(shí)候參數(shù)可能帶有 ","? 需要做判斷 ???????try ????????{ ????????????if(!string.IsNullOrEmpty(parm)) ????????????{ ????????????????ASPxGridView1.DataSource = ModuleCode.SelectModuleQuery(parm).Tables[0]; ????????????????ASPxGridView1.DataBind(); ????????????} ????????}??catch(Exception ex) {????? } ??}

?

獲取ASPxGridView1選擇行的值

?

?
1 2 3 4 KeyFieldName="POSTCODEID"??PreviewFieldName="POSTNAME,State,IsDelete">???? ??<ClientSideEvents FocusedRowChanged="function(s, e) { OnGridFocusedRowChanged(); }"/>? ??? ?<dxwgv:GridViewDataDateColumn Caption="崗位"FieldName="POSTCODE"></dxwgv:GridViewDataDateColumn>

?每個(gè)項(xiàng)? FieldName="POSTCODE" 隱藏也能取到值

?js代碼如下:

?

?
1 2 3 4 5 function OnGridFocusedRowChanged(index) {???????? ????????ASPxGridView1.GetRowValues(index,?'POSTCODEID;POSTNAME;POSTCODE;State;IsDelete', OnGetRowValues); } // 處理服務(wù)器端傳回的數(shù)據(jù)(values是個(gè)數(shù)組) function OnGetRowValues(values) {}

?

?C#回調(diào)方法:

?
1 index =? ASPxGridView1 的ASPxGridView1_HtmlRowPrepared? 遞加

?

?


歡迎大家踴躍討論并指出不足或錯(cuò)誤的地方,一定及時(shí)改進(jìn)。?
聯(lián)系QQ:106398492
Email:lyuec@sina.com

轉(zhuǎn)載于:https://www.cnblogs.com/ydfq-home/p/5017468.html

總結(jié)

以上是生活随笔為你收集整理的Dev控件用法 aspxTreeList 无刷新 aspxGridView 数据的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。