ComboBox in grid

Here is my column:
<mx:DataGridColumn 
headerText="Name" editorDataField="selectedValue"
width="
{accounts.width*.9}"
dataField="
ccompany">
</mx:DataGridColumn>
ItemEditor:
[Bindable]
 var availAccounsEditor:ClassFactory = new ClassFactory(comboItemRenderer); 
private function populateSalesRepsAccounts(resultXML:XML, dummy:Object):void{ 
var availAccounts:DataGridColumn = accounts.columns[0];availAccounsEditor.properties = {labelField :
"ccompany", dataProvider : resultXML.customers};availAccounts.itemEditor = availAccounsEditor;
ItemEditor:
package 
modulecode{
import flash.events.Event; 
import mx.collections.*;  
import mx.controls.*;  
import mx.controls.listClasses.*;  
import mx.events.*; 
public class comboItemRenderer extends ComboBox implements IDropInListItemRenderer {
private var _selectedValue:String; 
private var bSelectedValueSet:Boolean = false;  
private var bDataProviderSet:Boolean = false;  
public var dataProviderCopy:Object = new Object;  
public function comboItemRenderer(){
super();}
override public function set dataProvider(value:Object):void {
super.dataProvider = value;  
// This may get called before dataProvider is set, so make sure not null and has entries  
if (value!=null && value.length){
// Got it, set flag bDataProviderSet =
true;}
// Override committ, this may be called repeatedly  
override protected function commitProperties():void{
// invoke ComboBox version  
super.commitProperties();  
// If value set and have dataProvider  
if (bSelectedValueSet && bDataProviderSet){
// Set flag to false so code won't be called until selectedValue is set again bSelectedValueSet=
false; 
// Loop through dataProvider  
for (var i:int=0;i<this.dataProvider.length;i++){
// Get this item's data  
var item:String = dataProvider[i][DataGrid(listData.owner).columns[listData.columnIndex].dataField]; 
// Check if is selectedValue  
if(item == _selectedValue){
// Yes, set selectedIndex  
this.selectedIndex = i;  
break;}
override public function set data(value:Object):void{
super.data = value; selectedValue = value[DataGrid(listData.owner).columns[listData.columnIndex].dataField];
// set for selectedValue  
public function set selectedValue(s:String):void{
// Set flag bSelectedValueSet =
true; 
// Save value _selectedValue = s;
// Invalidate to force commit invalidateProperties();
public function get selectedValue():String{
return _selectedValue;}
How do set the the selected from combobox value back to dataGrid?
Thanks

Hi Lan
Try This For Matrix......
'For Adding Values
  oColumn = oColumns.Add(&quot;Drink&quot;, SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
        oColumn.TitleObject.Caption = &quot;Drink&quot;
        oColumn.Width = 100
        'Add Valid Values
        oColumn.ValidValues.Add(&quot;Cola&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;7up&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Fanta&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Orange Juice&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Water&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Lemonade&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Ice Tea&quot;, &quot;&quot;)
        oColumn.ValidValues.Add(&quot;Coffee&quot;, &quot;&quot;)
'For selected Value
Dim ocombo As SAPbouiCOM.ComboBox
            Dim oform As SAPbouiCOM.Form
            Dim omat As SAPbouiCOM.Matrix
            oform = SBO_Application.Forms.Item(&quot;MOR1&quot;)
            omat = oform.Items.Item(&quot;mat&quot;).Specific
            ocombo = omat.Columns.Item(&quot;Drink&quot;).Cells.Item(1).Specific
            ocombo.Select(&quot;Fanta&quot;, SAPbouiCOM.BoSearchKey.psk_ByValue)
Thanks
Shafi

Similar Messages

  • ComboBox Data Grid

    Ok i got the following service below which controls the data
    provider for the data grid. The variable anaLink is in a function
    that everytime when a item is selected from the combobox the link
    changes. But the problem is when i select a item from the list the
    data isn't refreshing in the grid. I refresh the service by the
    following line of code
    this.getAnalytics.send();. But it isn't working am i missing
    something.
    <mx:HTTPService id='getInfo' url='{anaLink}'
    useProxy="false" method="POST">
    </mx:HTTPService>

    Basically i took a look at your example its a little
    different from my code. When a person select a item from the
    comboBox it will change the compid in the url once that is done the
    database will be queryed and the new data will be displayed in the
    grid. Here is the code below.

  • ClassFormatError while running the code on application server

    Hi all,
    I have written some code which compiles and executes fine on JDeveloper but when I deploy the same code on Oracle Application Server it gives me ClassFormatError.
    The class which is giving the error is a simple Java Class, which is called by an ApplicationModule for doing the computation.
    JDeveloper version is 10.1.3.3.0
    Oracle AppServer version is 10.1.3
    Any help will be greatly appreciated.
    Below is the original stack trace:
    [06/10/2009 10:42:40 ERROR RtnAcknHandler:437] Error :: saveAcknForm in RtnAcknHandler
    com.demo.example.core.exception.GenericApplicationException: java.lang.reflect.InvocationTargetException
         at com.demo.example.core.manager.ApplicationModuleManager.callApplicationModule(ApplicationModuleManager.java:76)
         at com.demo.example.returns.ackn.service.RtnAcknServiceImpl.saveAcknForm(RtnAcknServiceImpl.java:16)
         at com.demo.example.returns.ackn.handler.RtnAcknHandler.saveAcknForm(RtnAcknHandler.java:422)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.demo.example.core.manager.HandlerManager.invokeHandler(HandlerManager.java:83)
         at com.demo.example.core.handler.FrontRequestHandler.handleRequest(FrontRequestHandler.java:161)
         at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at com.validation.utils.serversidevalidation.ServerSideValidationFilter.doFilter(ServerSideValidationFilter.java:81)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.demo.example.core.manager.ApplicationModuleManager.callApplicationModule(ApplicationModuleManager.java:71)
         ... 26 more
    Caused by: oracle.classloader.util.AnnotatedClassFormatError: Invalid length 65523 in LocalVariableTable in class file com/demo/example/returns/common/service/ReturnsITCasService
         Invalid class: com.demo.example.returns.common.service.ReturnsITCasService
         Loader: demoapp.web.webapp:0.0.0
         Code-Source: /D:/product/10.1.3.1/OracleAS/j2ee/DEMOAPP/applications/demoapp/webapp/WEB-INF/classes/
         Configuration: WEB-INF/classes/ in D:\product\10.1.3.1\OracleAS\j2ee\DEMOAPP\applications\demoapp\webapp\WEB-INF\classes
         Dependent class: com.demo.example.returns.ackn.appmodule.RtnAcknAMImpl
         Loader: demoapp.web.webapp:0.0.0
         Code-Source: /D:/product/10.1.3.1/OracleAS/j2ee/DEMOAPP/applications/demoapp/webapp/WEB-INF/classes/
         Configuration: WEB-INF/classes/ in D:\product\10.1.3.1\OracleAS\j2ee\DEMOAPP\applications\demoapp\webapp\WEB-INF\classes
         at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2285)
         at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1462)
         at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at com.demo.example.returns.ackn.appmodule.RtnAcknAMImpl.saveAcknForm(RtnAcknAMImpl.java:1454)
         ... 31 more
    Caused by: java.lang.ClassFormatError: Invalid length 65523 in LocalVariableTable in class file com/demo/example/returns/common/service/ReturnsITCasService
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2241)
         ... 39 more
    Edited by: user593821 on Oct 6, 2009 4:07 AM

    Hi,
    the exe has a GUI interface, with all types of windows User interface elements such as comboboxes, editboxes, grids, etc...
    I don't believe that is posible to do, but asked anyway in case i was wrong.

  • SDK Wishlist

    Thought we might have a Wishlist in here where we can post your wishes for the SDK.
    I know this is not the proper channels, but since the DRQ-department is too busy to handle all DRQ's lets get the word out here.
    My Wishlist (Based on SBO2005A)
    01 - Better performance
    02 - Modal Forms
    03 - Matrix Sorting
    04 - Matrix Sum Columns
    05 - Unified event for navigation system forms (et_RecordChanged)
    06 - DI Access to UDO-data
    07 - Better access to print (DI+UI)
    08 - A way to implement "Define New" in Comboboxes
    09 - Grid - Datatables using SQL: ALIAS
    10 - Access to Document Textlines type
    11 - LinkedButtons to UDO's

    I subscribe to the above...
    Overall point is to give the SDK the same functionality and integration as built in BO functionality. (For instance make UDO's more interchangeble with built in objects)

  • How to make the combobox column in grid can be selectable

    Hi,
    I have a grid in a form and use a SQL query as the data source. Now I want to make a column(a field in a SQL query) to be displayed as combobox and user can select it. I tried to use below code to make the column displayed like a combobox, it seems that the colunn becomes a dropdown box but i can't select it. Also I can't find a way to add valid value and description into this combobox like what I do on a combobox in a form.
    oGrid.Columns.Item("Approved").Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox;
    SAPbouiCOM.GridColumn col = oGrid.Columns.Item("Approved");
    then ???
    Any suggestion?
    Thanks!
    Lan

    Hi Lan
    Try This For Matrix......
    'For Adding Values
      oColumn = oColumns.Add(&quot;Drink&quot;, SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            oColumn.TitleObject.Caption = &quot;Drink&quot;
            oColumn.Width = 100
            'Add Valid Values
            oColumn.ValidValues.Add(&quot;Cola&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;7up&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Fanta&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Orange Juice&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Water&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Lemonade&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Ice Tea&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Coffee&quot;, &quot;&quot;)
    'For selected Value
    Dim ocombo As SAPbouiCOM.ComboBox
                Dim oform As SAPbouiCOM.Form
                Dim omat As SAPbouiCOM.Matrix
                oform = SBO_Application.Forms.Item(&quot;MOR1&quot;)
                omat = oform.Items.Item(&quot;mat&quot;).Specific
                ocombo = omat.Columns.Item(&quot;Drink&quot;).Cells.Item(1).Specific
                ocombo.Select(&quot;Fanta&quot;, SAPbouiCOM.BoSearchKey.psk_ByValue)
    Thanks
    Shafi

  • How do I get the value of a comboBox item that is in a grid?

    Hi all,
    I have a data grid that has comboBoxes in two of its columns.
    What I need to do is get the values of those bombo boxes when a user highlights the row of the grid NOT when the user uses the comboBox. I understand how to pull the values out once the change handler is invoked on the comboBox, but I'm not seeing a way to get at the comboBoxes that belong to the currently highlighted gridRow.
    I'm sure it's really straight forward, but I'm just not able to find any reference on how it's done. Any help greatly appreciated.

    This code shows how you can do it if you know the dataProvider fields for the ComboBox data.
    If this post answered your question or helped, please mark it as such.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
       initialize="initData()">
       <mx:Script>
       <![CDATA[
        import mx.events.ListEvent;
          import mx.collections.*;
          private var DGArray:Array = [
             {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99, combo1: [1,2,3], combo2: [100,200,300]},
             {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99, combo1: [2,4,6], combo2: [200,400,600]}];
          [Bindable] public var initDG:ArrayCollection;
          public function initData():void {
             initDG=new ArrayCollection(DGArray);
          private function dgChangeHandler(event:ListEvent):void{
           var ac:ArrayCollection = event.currentTarget.dataProvider;
           txt.text = "";
           txt.text += ac.getItemAt(event.rowIndex).combo1 + "\n";
           txt.text += ac.getItemAt(event.rowIndex).combo2;
       ]]>
       </mx:Script>
       <mx:DataGrid id="myGrid" width="350" height="200"
          dataProvider="{initDG}" change="dgChangeHandler(event);">
          <mx:columns>
             <mx:DataGridColumn dataField="Artist" />
             <mx:DataGridColumn dataField="Album" />
             <mx:DataGridColumn dataField="Price" />
             <mx:DataGridColumn dataField="combo1">
              <mx:itemRenderer>
               <mx:Component>
                <mx:VBox>
                 <mx:ComboBox dataProvider="{data.combo1}"/>
                </mx:VBox>
               </mx:Component>
              </mx:itemRenderer>
             </mx:DataGridColumn>
             <mx:DataGridColumn dataField="combo1">
              <mx:itemRenderer>
               <mx:Component>
                <mx:VBox>
                 <mx:ComboBox dataProvider="{data.combo2}"/>
                </mx:VBox>
               </mx:Component>
              </mx:itemRenderer>
             </mx:DataGridColumn>
          </mx:columns>
       </mx:DataGrid>
       <mx:TextArea id="txt" width="100%" height="100%"/>
    </mx:Application>

  • Grid filtering with textInput and TWO comboboxes...

    I am trying to combine some code based on Ben Forta's example
    and another I found on cflex.net. The idea is to have a text
    "as-you-type" search on a Grid, and also be filtered by not one,
    but two comboboxes, each pertaining to different columns of the
    grid. The code below works, but it is only 1 combobox and a
    textInput. How can I add the second combobox?
    Each piece of code works find on its own, but I'm just having
    trouble putting them all together. The second combobox's code is in
    block comment below.
    The rest of the application is like this: the grid is
    dgObjectList with dataProvider objectList. (ArrayCollection) It has
    objName, typeName, and courseName for columns. It is filtered via
    an inputText (for objName), and two comboBoxes cbTypeList and
    cbCourseList (for typeName and courseName). All three have
    change="objectList.refresh();"
    The resultHandler for the grid's data has:
    objectList.filterFunction=processFilter;
    And finally, here's the filter I have so far...any thoughts
    on getting the second combobox in there? The problem is once an if
    statement passes, the rest of the function doesn't run.
    quote:
    private function processFilter(item:Object):Boolean {
    var result:Boolean=false;
    dgObjectList.selectedIndex = -1;
    checkForDisplay();
    if(item.objName.length == 0 ||
    item.objName.toUpperCase().indexOf(searchText.text.toUpperCase())
    >= 0) {
    if(cbTypeList.selectedItem.typeName != "Show All") {
    return item.typeName == cbTypeList.selectedItem.typeName;
    } else if(cbTypeList.selectedItem.typeName == "Show All") {
    return true;
    /* Second ComboBox:
    if(cbCourseList.selectedItem.courseName != "Show All") {
    return item.courseName ==
    cbCourseListselectedItem.courseName;
    } else if(cbCourseList.selectedItem.courseName == "Show
    All") {
    return true;
    return result;

    Here is a complete working example.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="creationCompleteHandler(event);">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent
    [Bindable]
    public var theRegion: Array = [ {label:"State",
    data:1},{label:"North", data:"N"}, {label:"South", data:"S"} ];
    [Bindable]
    public var newPremise: Array = [ {label:"Premise",
    data:1},{label:"On", data:"ON"}, {label:"Off", data:"OF"},
    {label:"Military", data:"MI"} ];
    private var tmp_objectList:Array =
    {Premise: "On",Region: "North",objName: "Intro", typeName:
    "ColdFusion", courseName :"Intro To ColdFusion"},
    {Premise: "Off",Region: "South",objName: "Programming",
    typeName: "Flex", courseName:"Flex Programming"},
    {Premise: "Military",Region: "South",objName: "Development",
    typeName: "Apollo", courseName:"Apollo Development"}
    [Bindable]
    private var ObjectList:ArrayCollection;
    private function
    creationCompleteHandler(event:FlexEvent):void
    ObjectList = new ArrayCollection (tmp_objectList);
    ObjectList.filterFunction=processObjectListFilter;
    public function processObjectListFilter(item:Object):Boolean
    var result:Boolean=false;
    if (
    (txtFilter.text == '' || (item.objName != null &&
    String(item.objName).toUpperCase().indexOf(txtFilter.text.toUpperCase())
    >= 0)) &&
    (aRegion.selectedLabel == 'State' ||(item.Region != null
    item.Region.toUpperCase().indexOf(aRegion.selectedLabel.toUpperCase())
    >= 0)) &&
    (premisefilter.selectedLabel == 'Premise' ||(item.Premise !=
    null &&
    item.Premise.toUpperCase().indexOf(premisefilter.selectedLabel.toUpperCase())
    >= 0))
    result=true;
    return result;
    ]]>
    </mx:Script>
    <mx:ComboBox id="aRegion" dataProvider="{theRegion}"
    width="70" change="ObjectList.refresh();"/>
    <mx:ComboBox id="premisefilter"
    dataProvider="{newPremise}" width="85"
    change="ObjectList.refresh();" x="78"/>
    <mx:TextInput x="34" y="249" id="txtFilter"
    change="ObjectList.refresh();"/>
    <mx:DataGrid dataProvider="{ObjectList}" x="34" y="279"
    width="596">
    <mx:columns>
    <mx:DataGridColumn headerText="Region"
    dataField="Region"/>
    <mx:DataGridColumn headerText="Premise"
    dataField="Premise"/>
    <mx:DataGridColumn headerText="objName"
    dataField="objName"/>
    <mx:DataGridColumn headerText="typeName"
    dataField="typeName"/>
    <mx:DataGridColumn headerText="courseName"
    dataField="courseName"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Text x="34" y="223" text="Type As You Go Filters
    objName" color="#ffffff"/>
    </mx:Application>

  • How to fill grid column combobox with data?

    Hi Experts,
    I have a question about ComboBox column in a Grid item. I know how to set column to be a combobox, but question is - how to fill this combobox with ValidValues?
    I execute query for data table binded with grid and then change column's type to combobox.
    Regards
    Szymon Lipnicki

    Hi Szymon,
    You need to add the Value and Description to the Combo's ValidValue collection, just like with a normal Combo.
    I leave you a sample that shows how to fill a Combo from a RecordSet.
                Dim oRS As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
                oRS.DoQuery("SELECT T0.ListNum, T0.ListName FROM [dbo].[OPLN] T0")
                If oRS.RecordCount > 0 Then
                    Dim oGrid As SAPbouiCOM.Grid = oForm.Items.Item("grid").Specific
                    Dim oColumn As SAPbouiCOM.Column = oGrid.Columns.Item("PriceLst")
                    For i As Integer = 1 To oRS.RecordCount
                        oColumn.ValidValues.Add(oRS.Fields.Item(0).Value.ToString, oRS.Fields.Item(1).Value.ToString)
                        oRS.MoveNext()
                    Next
                End If
    Best Regards,
    Vítor Viera

  • Grid ComboBox column

    Hi all,
    I am considering moving from a matrix to a grid
    a. How do I assign valid values to a grid combobox column?
    b. Does the grid support all matrix features (link button, etc)?
    best,
    Asher

    Hi Chris,
    Here is my code:
                // Data table:
                DataTable dataTable = testForm.DataSources.DataTables.Add("aaa");
                dataTable.ExecuteQuery("SELECT * FROM [@AAA]");
                // Grid:
                Item gridItem = testForm.Items.Add("grd", BoFormItemTypes.it_GRID);
                gridItem.Width = 450;
                gridItem.Height = 300;
                Grid grid = (Grid)gridItem.Specific;
                grid.DataTable = dataTable;
                // Columns:
                GridColumn textColumn = grid.Columns.Item(2);
                ((EditTextColumn) textColumn).LinkedObjectType = "4";
                GridColumn comboColumn = grid.Columns.Item(0);
                comboColumn.Type = BoGridColumnType.gct_ComboBox;
                ((ComboBoxColumn) comboColumn).ValidValues.Add("3", "3");
    This code fails on the last line with this exception:
    Unable to cast COM object of type 'SAPbouiCOM.GridColumnClass' to interface type 'SAPbouiCOM.ComboBoxColumn'.
    Any ideas?
    Asher
    P.S.
    The link works fine. Thanks.

  • How to add values in the combobox that I have added in the Grid?

    Hi all,
    I have added a combobox to a Grid, i need to add values to that Combobox, how can i do it, Can anybody help
    Regards
    Cool Ice

    Hi Cool Ice,
    I'm use this code to add value to my combobox in my grid :
    string sQuery = "SELECT CRD1.Address FROM CRD1 WHERE CRD1.AdresType='S' AND CRD1.CardCode='" + oGrid.DataTable.Columns.Item("U_IFC_PP").Cells.Item(pVal.Row).Value.ToString() + "'";
                                        SAPbobsCOM.Recordset oRec;
                                        oRec = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                                        oRec.DoQuery(sQuery);
                                        SAPbouiCOM.ComboBoxColumn oCBB;
                                        oCBB = (SAPbouiCOM.ComboBoxColumn)oGrid.Columns.Item("U_IFC_ADR");
                                        oCBB.DisplayType = SAPbouiCOM.BoComboDisplayType.cdt_Value;
                                        while (!oRec.EoF)
                                            oCBB.ValidValues.Add(oRec.Fields.Item("Address").Value.ToString(), "");//, oRec.Fields.Item("Address").Value.ToString());
                                            oRec.MoveNext();
    Hope it's help you
    Regards
    Michael

  • Populate combobox grid view from sql server

    hello,
    is it possible to populate combo box from entries in sql server database
    also is it possible to populate grid view from entries in database including image files stored in binary format
    regards,

    Yes and yes.

  • Getting data in a combobox from database

    I have done database connectivity in flex using .net. Now I am getting data in flex in a data grid. Everuthing is working fine if I take data in a data grid.
    My problem is that if I try to take that data in any other control, other than data grid, it shows up no data, it only shows "object[object].
    for ex:
    if I am getting 3 rows from databse and I try to get those in a combo box, den I am getting 3 items in combo box like this:
    object[object]
    object[object]
    object[object]
    instead of actual data.
    I am stuck in this problem for last 3 days. I have tried lot of things but nuthing is working. Plz anyone help me out soon. Its really urgent.
    I am working on a live project and not able to proceed because of this problem.

    Hi Bhavika,
    You need to tell your combobox which value should be displayed in the ComboBox...for display...
    You are getting 3 rows from database which are objects since you haven't told your combobox which value to be displayed it is displaying as [Object,Object]...
    So you need to tell your ComboBox which values to be displayed ..and you can do this by assigning the labelField property of the ComboBox..
    Say in your object you have three properties say..data, value, name...etc;;
    Then if you want display name as your ComboBox display label then simply write ....labelField="name" in your ComboBox ...
    Thanks,
    Bhasker Chari

  • Display image into Data Grid

    Hello,
    I have to display into a data grid, in Flex 2, 2 columns:
    first column ( "Images") must contain a picture with an object and
    second column (" quantity") must contain the amount of that object
    that I want to buy. The problem is that I must take the name of the
    image from an .xml file, specified like this:
    <mx:DataGrid id="obj" dataProvider="{ObjList}" > where
    ObjList is the .xml file with <name/>
    <picture_address/> etc.
    The second column must contain a textbox so I can input a
    number of items for each picture ( can be also a combobox where
    from I can select some value, from 1 to 20 for example).
    I've searched the Internet and I haven't found a solution
    yet. Please give me a link or a solution for this problem.
    Tudor

    use itemrenderes.... the example below shows how to add an
    image.... you can do the same thing with a text box or combo box
    <mx:DataGridColumn width="10" headerText="Image">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Canvas width="100%" height="100%">
    <mx:Image verticalCenter="0" horizontalCenter="0"
    source="{data.picture_adress}""/>
    </mx:Canvas>
    </mx:Component>
    </mx:itemRenderer>

  • How to display data in a grid after selecting topic from combo box?

    could someone help me out? i'm displaying a combo box (about
    20 items) vertically. when user selects one of these items, i'd
    like for information regarding that choice to be displayed in my
    data grid. thanks - Karl from Kansas

    If you have the following:
    <mx:ComboBox id="combo_box" dataProvider="{users}"
    labelField="user_name" change="show_details(event)"
    ></mx:ComboBox>
    <mx:DataGrid id="data_grid" >
    <mx:columns>
    <mx:DataGridColumn headerText="Name"
    dataField="user_name"/>
    <mx:DataGridColumn headerText="email"
    dataField="email"/>
    </mx:columns>
    </mx:DataGrid>
    private function show_details(evt:Event):void {
    data_grid.dataProvider = evt.currentTarget.selectedItem
    This assumes that your combo box data has a user_name and
    email property value. Substitute your property values where needed.
    Vygo

  • How to edit cell in a Data Grid

    Hai
        I have pasted the mxml below.
       I need how to edit a cell in a datagrid.
      1. Run the mxml, enter the values in the textbox and click add button.
      2. then click AND button, now u can see the values displayed in the grid.
    3. Then again change the second combobox and enter the values in the textbox and click add
    4. Now i need to edit the values for a particular cell in the datagrid.
    In the below code u can see the Value column,
    i need to edit oly that cell of a particular row .
    Can anyone help me.
    Thanks in Advance
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    // ActionScript fileimport  
    mx.rpc.events.FaultEvent;
    import  
    mx.controls.Alert; 
    import mx.managers.CursorManager;
    import  
    mx.collections.ArrayCollection;[
    Bindable] 
    public var adhoc:ArrayCollection = new ArrayCollection();[
    Bindable] 
    public var serverString = "" ; 
    private function initImage(event:MouseEvent):void { 
    if(adhoc.length > 0){CursorManager.setBusyCursor();
    private function onChange():void{ 
    if(comboBox.selectedIndex == 0){ 
    else{ 
    private function onChange1():void{ 
    if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){datepick.visible =
    truetxt.visible =
    false}
    else{txt.visible =
    truedatepick.visible =
    false}
    private function add():void

    You can enable editing in a DG to the whole DG or only to certain columns
    http://blog.flexexamples.com/2008/05/11/creating-an-editable-datagrid-control-in-flex/
    If you want to enable editing to a very specific cell then you use the event itemEditBegin to prevent editing a cell that doesn't meet your criteria
    http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_7.html

Maybe you are looking for