轉(zhuǎn)帖|使用教程|編輯:龔雪|2017-01-23 13:12:02.000|閱讀 910 次
概述:ASPxListBox使用技巧及代碼示例
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在ASPxListBox中如何進(jìn)行數(shù)據(jù)綁定,添加或刪除Item?
The ASPxListBox control allows you to modify the ASPxListEdit.Items collection on callbacks only (e.g. add and remove items, populate the controls with new data from a data source, etc.).
It is not possible, for example, to modify a column collection, change items selection, or change SelectionMode on callbacks. To perform these actions on the client side, you can wrap the control with theASPxCallbackPanel control and process a required scenario on a callback to the panel.
(來自DevExpress 官方幫助文檔)
添加刪除Item只能在callback事件中處理,客戶端調(diào)用語句:
<dx:ASPxButton ID="btnDeleteUpload" runat="server" Text="刪除已有" AutoPostBack="false" Style="margin: 16px auto;"> <ClientSideEvents Click="function(s, e) { listAttachment.PerformCallback(listAttachment.GetSelectedIndex());}" /> </dx:ASPxButton>
PerformCallback的參數(shù)可以傳遞要?jiǎng)h除的ItemIndex。
服務(wù)器端:protected void listAttachment_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) 中處理數(shù)據(jù)綁定或者刪除Item ,利用e.Parameter的值來判斷。
如何實(shí)現(xiàn)在listbox中選中所有button?
// Set - SelectionMode="Multiple" for your ListBox and then do protected void LinkButton1_Click1(object sender, EventArgs e) { foreach (ListItem li in ListBox1.Items) { li.Selected = true; } }
想要了解更多DevExpress使用技巧?海量視頻課程以及最專業(yè)的DevExpress培訓(xùn)盡在。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn