Hide a data column in combo box?

I want to load a combo box from a database with two values per row (add.Item ?) but I only want one value to be see by the end-user.
Example:
Hidden | Shown
12320  |  Green
19210  |  Red
72622  |  Yellow
The user will see the colors but not the numeric values. The numeric values are actually the auto_id for each color in the database. I want to use the auto_id when I save the user's choice to another table instead of the color name.
Right now as soon as the use selects a color I hit the database for the auto_id number - that can't be good.
Thanks,
ADawn
ADawn

Hello,
You would set the data source for the ComboBox that has your data then set DisplayMember to the field to show in the ComboBox along with ValueMember set to the hidden field. Now say in a button click event use ComboBox1.SelectedValue to get the hidden field,
cast as an integer if that is the data type of the hidden field.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Similar Messages

  • How to hide certain items in a Combo Box

    I've two Combo Box(CB). First CB contain 4 items(drop-down menus) and the 2nd CB contain 12 items.
    I want that when I select one of the items from Combo Box1, then only 4 out of 12 items from Combo Box2 should be visible. So actually I want first combo Box to act as filter. Could this be done using the AS3 code.

    I don't think there is any way to hide items, but you can rewrite he items basd on the selectedIndex value of the cbHeight combobox.  In the code below, each element of the weightData array is an array of objects.
    import fl.data.DataProvider;
    var weightData:Array = new Array(); 
    weightData.push([{label: "100"},{label: "110"},{label: "120"},{label: "130"}]);
    weightData.push([{label: "200"},{label: "210"},{label: "220"},{label: "230"}]);
    weightData.push([{label: "300"},{label: "310"},{label: "320"},{label: "330"}]);
    function heightSelected(evt:Event):void
         var hSelected:int = evt.target.selectedIndex;
         var dp:DataProvider = new DataProvider(weightData[hSelected]);
          cbWeight.dataProvider = dp;

  • Need Help. Data jumps between Combo Boxes in an ADG

    I have an item renderer in an advanced datagrid.
    <mx:AdvancedDataGridColumn
        dataField="USE_TYPE_DESC"
        headerText="Use Type"
        rendererIsEditor="true"
        itemRenderer="renderers.tpUseTypeDropDown"
        editorDataField="getData"/>
    But the data that gets displayed in the combo boxes, appear to jump between CBs when you scroll the ADG up and down. The physical data is fine, its just the displayed data that is wrong.. Any ideas

    Ok, I tried this but still getting an error
    <cfquery datasource="mydb" name="test">
    Select name from mytable
    where
    <cfqueryparam value=#createodbcdate(edate)# cfsqltype="CF_SQL_DATE"> Between '01/01/2011' AND '01/01/2013'
    </cfquery>
    <cfoutput query="test">
    #ename#
    </cfoutput>
    now I get
    An error occurred while evaluating the expression:
    "#createodbcdate(edate)#"
    Error near line 3, column 53.
    Error resolving parameter EDATE

  • How to populate data in the data table on combo box change event

    hi
    i am deepak .
    i am very new to JSF.
    my problem is i want to populate data in the datatable on the combo box change event.
    for example ---
    combo box has name of the city. when i will select a city
    the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
    its urgent
    reply as soon as possible
    thanks in advance

    i am using Rational Application Developer to develop my application.
    i am using a combo box and i am assigning cityName from the SDO.
    and i am declaring a variable in the pageCode eg.
    private String cityName;
    public void setCityName(String cityName){
    this.cityName = cityName;
    public String getCityName(){
    return cityName;
    <h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
                        <f:selectItems
                             value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
                   </h:selectOneMenu>
                   <hx:behavior event="onchange" target="menu1" behaviorAction="get"
                        targetAction="box1"></hx:behavior>
    and also i am declaring a requestParam type variable named city;
    and at the onChangeEvent i am writing the code
    public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
    requestScope.put("login",(String)valueChangedEvent.getNewValue());
    and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
    it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
    it is possible that i may not clear at this point.
    please send me the way how my problem can be solved.
    thanks in advance

  • Not able to populate data in the combo box

    Hi Guys,
    I m new to flex development and I want to populate the data
    coming from the databasein the combobox.I am able to get the length
    .but not able to populate the data.
    Can anyone helpme out?
    The code is below:
    The data displayed in the combox box is displayed as
    [object],[object] etc.I m sure that the data is coming from the
    database and its not populated in the combo box.any help is
    appreciated.
    private function getParkinfo(event:ResultEvent):void
    { Alert.show(event.result.length.toString());
    countries.dataProvider = event.result;
    <mx:ComboBox id="countries" />

    What does the data look like in the result? Is it XML? Post a
    sample of it.

  • Load data in a combo box dynamically

    hello everybody!
    I need to load a combo box, depending on the selected data in another, eg by selecting the country and loaded societies selected country.
    Someone could guide whether this is possible, and if you have any examples that would be great.
    greetings

    user javascript events. "onload" and call some method so that it'll do your job(adding elements to combo).
    Edited by: Diablo_Chiru on May 15, 2008 4:35 AM

  • Setting Data Field of Combo Box

    I have a result set passed back as an Array. I want to set
    and reference a combo box with those values
    The first element in the array should be the data, the second
    should be the label
    I can get the label set, but i Cannot get and set the "data"
    the actually selected value.
    For example: my function is
    public function onResult_getSkillsetNames( result : Array ) :
    void
    skillsetName_cmb.dataProvider = result;
    skillsetName_cmb.labelField = "skillsetName";
    skillsetName_cmb.selectedItem = result[0];
    skillsetName_cmb.text = result[1];
    //skillsetName_cmb= results[0];

    Look this post.
    Combo Box dataField
    Support
    This may help you if you want to select another index than
    the index of the dataprovider.
    Best

  • Binding Data to a Combo Box

    Using ODP.Net,
    Does anybody have sample code for binding a column in a table to a combo box in either a web form or in a window application in .NET 2003
    Thanks,
    Declan

    There's nothing special about doing this with ODP.NET.
    Any example of ADO.NET databinding should work with ODP.NET.
    eg
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_RetreiveandProcessDatawithaSQLDataReader.asp
    or
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=dotnet+databind+combobox
    David

  • Needs multi column dynamic combo box using C#

    I need a dynamic Combo box to display multi columns on Drop Down Event 
    such as Stock Code, Make, Model,Sub Model, Measurement Type and so on for  my C# Application with Columns Headers 
    Please Help Me
    Thanks in Advance

    You should create a class that represents your model and then you could use a CompositeCollection as the ItemsSource of the ComboBox.
    Here is an example for you:
    namespace WpfApplication59
    public class YourModel
    public string StockCode { get; set; }
    public string Model { get; set; }
    //+ the rest of your properties
    MainWindow.xaml.cs:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    List<YourModel> models = new List<YourModel>();
    models.Add(new YourModel() { Model = "m1", StockCode ="c1"});
    models.Add(new YourModel() { Model = "m2", StockCode = "c2" });
    cb.ItemsSource = models;
    MainWindow.xaml:
    <ComboBox x:Name="cb" Grid.IsSharedSizeScope="True" ItemsSource="{DynamicResource items}"
    xmlns:local="clr-namespace:WpfApplication59">
    <ComboBox.Resources>
    <CompositeCollection x:Key="items">
    <ComboBoxItem IsEnabled="False">
    <Grid TextElement.FontWeight="Bold">
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="Model"/>
    <TextBlock Grid.Column="2" Text="Stock Code"/>
    </Grid.Children>
    </Grid>
    </ComboBoxItem>
    <Separator/>
    <CollectionContainer Collection="{Binding Source={x:Reference cb}, Path=DataContext}"/>
    </CompositeCollection>
    <DataTemplate DataType="{x:Type local:YourModel}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="{Binding Model}"/>
    <TextBlock Grid.Column="2" Text="{Binding StockCode}"/>
    </Grid.Children>
    </Grid>
    </DataTemplate>
    </ComboBox.Resources>
    </ComboBox>
    You could restyle the the templates (Grids) as per your requirements.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

  • How to hide a data column in a planning Layout

    Hi experts,
    we use BW-BPS and I need some datacolums in planning layout, which should be calculated.
    Rest Volume = Forecast - Actual
    The customer wants to see only the "Rest Volume".
    But i need for calculation Forecast and Actual values, which are available in Infocube.
    Do you know how to hide some colums in planning layout ?
    thanks a lot.

    Write a one line macro in SAPAfterDataPut sub module and check the option in the tab MS Excel Settings in the last screen of the layout.
    Sample macro:
    suppose the column you want to hide is 4.
    columns(4).hidden = true

  • How do I retrieve data from combo boxes?

    The past weekend I spent my whole weekend trying to find this
    out and gone through the top 10 pages on google trying all sorts of
    things. I would be grateful for anyone who can help me.
    I have 6 combo boxes in a booking form and I need to retrieve
    the data when someone click submits which gets forwarded on to php
    then my mailbox. They are called box1_cb, box2_cb.....box6_cb All
    in the instance of: ComboBox - which I don't understand what that
    does.
    it does not seem to be retrieving any of the data. For each
    combo box:
    I have the the options people can choose form in "Labels" box
    under "Paramaters", nothing for "Data", Row Count is 8 and nothing
    for "Change Handler" which I don't know what it does.
    Can anyone please provide some help with telling me what
    "change handler" does, do I need the data for each combo box in the
    "Labels" parameter as well as the "Data" box, what an instance does
    (for combo boxes) and what I need to put in the actionscript for
    the submit button as well as do i need to put code in the
    actionscript for each combo box?
    The options people can choose from in the combo boxes are
    there when someone views the site.
    Can anyone please help me..I would greatly appriciate it.
    Thanks.

    If your hard drive can be detected and shows up as a drive letter in my computer but you can't access your files,then you can recover your data off it with data recovery software easily.This way is the easiest and the most inexpensive way to recover your data.If you bring it to a computer repair shop that is available for data recovery servise,they will cost you $500-1000 or more.Hmm, a lot of money.
    I managed to recover data from crashed hard drive with Tenorshare Data Recovery.If needed,you can download it and scan your hard drive for free to preview whether your data can be recovered.It will show you thumbnails for recoverable pictures.

  • Problem with combo box in a Matrix column

    hi every one, i  have a user form with a matrix(uid = 37) with some columns and one column is combo box. in that combo box i have to get values  from OSTC table (Code)...i have written this code ..i dont know how to access the combo box so that i can get values to combo box when i execute the prg....
    oitem = oForm.Items.Item("37")  37 is uid of omatrix2
                oMatrix2 = oitem.Specific
                oColumns = oMatrix2.Columns
                oForm.DataSources.UserDataSources.Add("CSR1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
                oColumn = oColumns.Item("V_6")                      ''for accessing the combo box item [V_6 is col uid ]
                oCombo = oColumn.Cells.Item(omatrix2.row).Specific            ''''''''problem line
                oCombo.DataBind.SetBound(True, "", "CSR1")
                rset = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                query = "select Code from OSTC"
                rset.DoQuery(query)
                Dim tc As String
                rset.MoveFirst()
                For row = 0 To rset.RecordCount - 1
                    tc = rset.Fields.Item("Code").Value
                    oCombo.ValidValues.Add(tc, row)
                    rset.MoveNext()
                Next
                oMatrix2.Columns.Item("V_6").DataBind.SetBound(True, "@SALE_CHILD", "U_Tax")

    Call objMain.objUtilities.LoadComboValuesForMatrix(FormUID, "27", "SELECT Code,Name FROM OSTC Order by Code", "V_19", objMatrix.RowCount)
    Public Sub LoadComboValuesForMatrix(ByVal FormUID As String, ByVal ItemUID As String, ByVal strQuery As String, ByVal MtrxColId As String, ByVal Rowcount As Integer)
            Dim inti As Integer
            objRecSet = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            Try
                Dim objmatrix As SAPbouiCOM.Matrix
                Dim objCombo As SAPbouiCOM.ComboBox
                objForm = objMain.objApplication.Forms.Item(FormUID)
                objItem = objForm.Items.Item(ItemUID)
                objmatrix = objItem.Specific
                objCombo = objmatrix.Columns.Item(MtrxColId).Cells.Item(Rowcount).Specific
                objItem.DisplayDesc = True
                objRecSet.DoQuery(strQuery)
                If objRecSet.RecordCount > 0 Then
                    If (objCombo.ValidValues.Count > 0) Then
                        For inti = 0 To objRecSet.RecordCount - 1
                            objRecSet.MoveNext()
                        Next
                    End If
                    If (objCombo.ValidValues.Count <= 0) Then
                        objCombo.ValidValues.Add("", "")
                        For inti = 0 To objRecSet.RecordCount - 1
                            objCombo.ValidValues.Add(Convert.ToString(objRecSet.Fields.Item(0).Value), Convert.ToString(objRecSet.Fields.Item(1).Value))
                            objRecSet.MoveNext()
                        Next
                    End If
                End If
            Catch ex As Exception
                Throw ex
            Finally
                System.Runtime.InteropServices.Marshal.ReleaseComObject(objRecSet)
                GC.WaitForPendingFinalizers()
                GC.Collect()
            End Try
        End Sub

  • To filter data in two dates using combo box component

    Hi,
    I have a requirement like, i need to filter data in chart between two dates from two combo box.. From combo_box and To combo_box.
    I am using one QaaWS to populate LOV's into Combo box's and another QaaWS for chart data. Universe is the same one on SAP  BI query.
    LOV's are populating into both combo's and chart as well, i used a query refresh button after choosing two dates and press button.
    Data is not reflecting as per the choice of dates.
    If any one have such scenario, request you to share the same....
    Thanks in advance...
    Raj..

    Problem is with ranges, not with dates, my data is working fine with CALDAY (in BI Query)....
    My query variable is on FiscalPeriod month, like "FEB 2011"  to "OCT 2011" and is optional, but it is fails in QaaWS to execute when i try to input any months.
    If we give default values in BI query format is like K4/010.2011 for october month. QaaWS doesnt fail and executes, but if i change any value in QaaWS it is taking as "OCT 2011"
    And in Xcelsius it is not recognizing eaither of the formats like, K4/010.2011 or "OCT 2011"
    the format is not matching with xcelsius.

  • Source Data option won't dispaly on combo box proprieties.

    I am trying to use combo box to dispaly a serie of data but when activated, the source data for the combo box is not available. Any idea what might be the problem and how can I resolve it?
    Thanks.

    The source data is not available for certain insert options as they do not need source data.
    These options are position, label and status list.
    If you switch to any of the other insert types, you can then bind your source data.

  • Getting Dates using combo boxes

    I am trying to get a start date and an end date from a combo
    box. I have the following AS3 code but it doesn't work. startDay,
    startMonth etc are all comboboxes with appropriate data. Just can't
    figure the syntax to make it work.
    var start_date = new
    Date(startYear.selectedIndex,startMonth.selectedIndex,startDay.selectedIndex);
    var end_date = new
    Date(endYear.selectedIndex,endMonth.selectedIndex,endDay.selectedIndex);
    then i want to calculate and display the total days
    var nDiffDays = Math.floor((end_date - start_date)/86400000);
    totalDays_txt = nDiffDays;
    Any help appreciated.

    There are two of those controls: the drop down list and the combo box. Try the drop down list instead.

Maybe you are looking for

  • Controlling Font Size in Character Mode Reports

    Hi, The default Font size of Character mode Reports is 12. I want to reduce the font size from 12 to 8 .How to go about it.The printer codes mentioned in reports Documentation only talk about other attributes like Bold etc.Also the documentation gave

  • Large messages cannot be saved out from tracking

    Hi, Using BizTalk 2013 Enterprise, we cannot save out larger messages from tracking. In one example we have an XML-message of 6 MB, saving it renders a zero byte file. Smaller messages can be saved. Any ideas what this could be? Is it a known problem

  • Date format to get week result

    Dear all i had one question for date API need to ask someone else, how can i convert the Date to week for example the result if like this 3    |      4    |    5      | 6       | 7 08/20 08/21 08/22 08/23 08/24 what is the java API i can use to calcu

  • Difficulty with simple clipping mask project

    I'm just learning Illustrator (CS3) and have a simple project that I'm having trouble with. I'm hoping someone can give me a brief step-by-step. Basically, I'm making a cube and want to "insert" a photo into the front side of the cube using a clippin

  • Fedex delivery iPod replacement

    I've seen other posts by people complaining about this but I haven't found one with a solution so I'm starting a new discussion. FedEx tried to deliver my ipod replacement three times during the holidays while I was out of town. I called FedEx and th