2017-09-01 89 views
0
<dx:GridViewDataComboBoxColumn Caption="<%$Resources: zione%>" Width="15%" Visible="true">         
    <DataItemTemplate> 
     <dx:ASPxComboBox ID="comboZione" 
         runat="server" 
         ValueField="TIPB_CTBZIONE" 
         TextField="DEFI_CTBZIONE" 
         OnDataBinding="comboZione_OnDataBinding" 
         EnableCallbackMode="false" 
         OnSelectedIndexChanged="combo_OnSelectedIndexChanged"> 
     </dx:ASPxComboBox> 
    </DataItemTemplate> 
</dx:GridViewDataComboBoxColumn> 

在後面的代碼:Devexpress如何在ComboBox DataBinding方法中獲取索引行?

protected void comboZione_OnDataBinding(object sender, EventArgs e) 
{ 
    ASPxComboBox cmb = (sender as ASPxComboBox); 
    cmb.DataSource = ddlLoadZione(IndexRow); 
    // Here I want to bind the different combox on which row, 
    // but I needed a index row to do this. 
} 

索引行需要我得到了行權價值。

Grid.GetRowValues(**IndexRow**, "FieldName") 
+1

你或許應該問的DevExpress的直接支持,只有在那裏工作有了解如何做任何事情任何機會的人與DevExpress ...這是一個非常痛苦的圖書館工作。另外,你的問題不是很清楚 – musefan

回答

0

爲了完成這個任務,我建議你用在The general technique of using the Init/Load event handler文章中介紹的方法,並在其Init事件處理程序中設置的組合框」 DataSource屬性。

我相信這是可能的:

  1. 處理的ASPxComboBox.Init事件;
  2. 根據您的自定義條件(行值等)提供ASPxComboBox.DataSource。

參考這些:
ASPxGridView - Bind ASPxComboBox placed in DataItemTemplate
ASPxGridView - How to bind controls placed in the DataItemTemplate with the data field of the grid row
ASPxComboBox on each line/DataItemTemplate of ASPxGridView
ASPxGridView - How to bind ASPxComboBox in the data item template