[英]Rowdatabound equivalent in webdatagrid of infragistics
我正在尋找我們在asp.net gridview中的rowdata綁定事件。 我想要實現的是這個。
e.row.rowtype == datacontrolrowtype.datarow
關於webdata網格的數據綁定事件,但它沒有工作,所以我怎么能實現這一點。 關於如何獲得行類型及其事件將有所幫助的建議。
好吧,不是100%確定你的意思是通過實現'this'而是...... WebDataGrid提供了2個版本的此類事件,因此無論您嘗試什么,都可能與這些事件有關。 至於我得到你的代碼行,你只對數據行感興趣,並且就我所知,僅針對數據行觸發了以下與行相關的事件(絕對不是我的經驗中的標題或摘要行):
服務器端 :當網格綁定到數據源中的記錄時,將引發InitializeRow事件 。 您可以在常規控件屬性中找到它,或者在標記的頂層添加<ig:WebDataGrid oninitializerow="WebDataGrid1_InitializeRow"...
在處理程序中,您可以訪問網格和行,並且此事件被觸發每個數據行總是:
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e) { // Use: //e.Row.DataItem //e.Row.DataKey //e.Row.Index }
Client Side Row Rendered / -ing事件,僅在啟用客戶端綁定/呈現時觸發。 在行之前/之前觸發的事件呈現給DOM,通過添加<ClientEvents RowRendered="test" />
,其中test是JavaScript中處理函數的名稱:
function test(webDataGrid, evntArgs) { //The data object with all attributes evntArgs.get_dataItem(); //Reference to the actual TR element evntArgs.get_rowElement(); //Returns index of the row inside of its container collection. evntArgs.get_index(); //Returns data key of the row. It is always an array of objects even in a case of a single data key field. evntArgs.get_dataKey(); }
我認為你應該能夠做你想做的事情。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.