devExpress GridView中的ComboBox [英] ComboBox in devExpress GridView
本文介绍了devExpress GridView中的ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在devexpress gridview的一列中使用了组合框(有2个默认值)。如何获取该组合框的选定值?
即,在dx:ASPxGridView控件中,我有这样的组合框
< dx:GridViewDataTextColumn FieldName = selectState 标题 = selectState VisibleIndex = 1 >
< dataitemtemplate >
< dx:ASPxComboBox ID = selectState1 runat = 服务器 值 =' <% #Bind( selectState)%>' 宽度 < span class =code-keyword> = 70px EnableCallbackMode = true >
< 项目 >
< dx:listedititem 文字 = on 值 = on < span class =code-attribute> / >
< dx:listedititem 文本 = off 值 = off / >
< / items >
< / dx:ASPxComboBox >
< / dataitemtemplate >
< / dx:GridViewDataTextColumn >
>
如何获得组合框的选定值?
提前谢谢
解决方案
< blockquote>使用下面的代码从ComboBox中获取所选值。
for ( int row = 0 ; row < gridview1.VisibleRowCount; row ++)
{
ASPxComboBox ddlStatus =(ASPxComboBox)gridview1.FindRowCellTemplateControl(row, null , ddlStatus);
string status = ddlStatus.SelectedValue;
}
I used combo box(with 2 default values) in one of the column of a devexpress gridview. How to get the selected value of that combo box?
ie, in dx:ASPxGridView control, I have combobox like this
<dx:GridViewDataTextColumn FieldName="selectState" Caption="selectState" VisibleIndex="1" >
<dataitemtemplate>
<dx:ASPxComboBox ID="selectState1" runat="server" Value='<%#Bind("selectState") %>' Width="70px" EnableCallbackMode="true" >
<items>
<dx:listedititem Text="on" Value="on" />
<dx:listedititem Text="off" Value="off" />
</items>
</dx:ASPxComboBox>
</dataitemtemplate>
</dx:GridViewDataTextColumn>
how to get the selected value of the combo box?
Thanks in advance
解决方案
Use this below code to get the selected value from the ComboBox.
for (int row = 0; row < gridview1.VisibleRowCount; row++) { ASPxComboBox ddlStatus = (ASPxComboBox)gridview1.FindRowCellTemplateControl(row, null, "ddlStatus"); string status = ddlStatus.SelectedValue; }
这篇关于devExpress GridView中的ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文