asp.net - ComboBox in GridView -


i can't access combo box's value using in gridview.

gridview this:

<dx:gridviewdatatextcolumn caption="cmb" fieldname="cmb" name="cmb"                 visibleindex="4">                 <dataitemtemplate>                <dx:aspxcombobox id="aspxcombobox1" runat="server" autopostback="false"                       clientidmode="autoid" datasourceid="sqldatasource2"                    enablesynchronization="true" textfield="rolad" valuefield="rolid"                         valuetype="system.int32">                     </dx:aspxcombobox>                 </dataitemtemplate>            </dx:gridviewdatatextcolumn>  

when accessing fields following codes,it's coming null datas combobox.

 list<object> selectedvalues;      private void getselectedvalues()     {         list<string> fieldnames = new list<string>();         foreach (gridviewcolumn column in aspxgridview1.columns)            if (column gridviewdatacolumn)                 fieldnames.add(((gridviewdatacolumn)column).fieldname);         selectedvalues = aspxgridview1.getselectedfieldvalues(fieldnames.toarray());  

you might give try

gridview_id.findcontrol("aspxcombobox1") 

to retrieve combobox


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -