How to use combobox in devexpress aspxgridview

asp.netaspxgridviewcomboboxdevexpress

I am displaying my data in a devexpress gridview. One of the column is state value. When the grid is edited, I have to show the state in a combobox, so that the user could change the state by choosing a different state. Currently it is displayed in a textbox, since it is the default. Essentially when the user clicks the edit button, a combobox should be displayed as part of the edit controls, and the combobox should be populated with all possible states in the codebehind and the selected value should be the initial value on the grid. It is very easy do it in MS gridview. But I couldn't see any sample code for how to do it in the devexpress gridview.

Thanks

Best Answer

  <dx:GridViewDataTextColumn FieldName="FieldName" VisibleIndex="4">
          <EditItemTemplate>
                <dx:ASPxComboBox ID="ASPxComboBox1" runat="server" DataSourceID="newDataSource" >
                </dx:ASPxComboBox>
           </EditItemTemplate>
  </dx:GridViewDataTextColumn>

You'll need to set the datasource so you'll get the list of values