in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Populate Combo Box dynamically through data binding AND manually

Last post 9/28/2007 8:49 AM by Mehul Harry (Developer Express). 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 9/27/2007 8:17 AM

    Populate Combo Box dynamically through data binding AND manually

    Hi there,

    I have a combo box within a GridView that is bound to a data source, but I also want to add a single item manually as a default (I think this functionality was available in the previous version of your Grid.) I have tried to add in the Items in the Editor Form (see the zipped doc attached) but this has no affect on the collection. Is this possible?

    Thanks again..

     

  • 9/27/2007 7:52 PM In reply to

    Re: Populate Combo Box dynamically through data binding AND manually

    Hi Margaret,

    For the ASPxGridView, you can use the PropertiesComboBox -> Items property when you have a ComboBox Column.

    Thanks. 

       31             <dxwgv:GridViewDataComboBoxColumn VisibleIndex="6">
       32                 <PropertiesComboBox>
       33                     <Items>
       34                         <dxe:ListEditItem Text="test1" Value="test1">
       35                         </dxe:ListEditItem>
       36                     </Items>
       37                 </PropertiesComboBox>
       38             </dxwgv:GridViewDataComboBoxColumn>

     

    Filed under:
  • 9/28/2007 5:17 AM In reply to

    Re: Populate Combo Box dynamically through data binding AND manually

    Hi

    My combo is bound to a datasorce, but I also would like to add an extra item manually, is this possible, I had tried the code below but it doesn't add the manual one to the list.

    <

    dxwgv:GridViewDataComboBoxColumn Caption="Journey" FieldName="JourneyCode" VisibleIndex="4">
    <PropertiesComboBox DataSourceID="dsTrips" DisplayImageSpacing="" TextField="Journey"ValueField="JourneyCode">
    <ClientSideEvents SelectedIndexChanged="function(s, e) {ParseDivisions() ; } " />
    <Items>
    <dxe:ListEditItem Text="Other" Value="O">
    </dxe:ListEditItem>
    </Items>
    </PropertiesComboBox>
    <EditFormSettings VisibleIndex="4" />
    </dxwgv:GridViewDataComboBoxColumn>
  • 9/28/2007 8:49 AM In reply to

    Re: Populate Combo Box dynamically through data binding AND manually

    Hi Margaret,

    Please take a look at the following support issue:

    aspx combobox items add 

    For this solution, you can use a regular text column and just add an ASPxComboBox to the EditTemplate for that column. It'll bind the same but you'll be able to call the clientside events for that ASPxComboBox to add the items (as the issue suggests).

                <dxwgv:GridViewDataTextColumn Caption="Journey" FieldName="JourneyCode" VisibleIndex="4">
                    <EditItemTemplate>
                        <dxe:ASPxComboBox ID="cbJourney" runat="server" ClientInstanceName="cbJourney" DataSourceID="dsTrips"
                            EnableClientSideAPI="True" TextField="Journey" ValueField="JourneyCode">
                            <ClientSideEvents Init="function(s, e) { cb1.AddItem('CUSTOMITEM'); }" />
                        </dxe:ASPxComboBox>
                    </EditItemTemplate>
                </dxwgv:GridViewDataTextColumn>

    Thanks. 

    Filed under:
Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED