Datagrid with comboBox headerRenderer question

Hi All,
I have a comboBox as header renderer in my datagrid.
How can I fire a function that it is in my main form (where the datagrid is) when I change the selected item in the comboBox?
Thanks
Johnny

Why my HTML Code didn't show.
<?xml version="1.0" encoding="utf-8"?>
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
             labelField="label" dataProvider="{acCombo}" rowCount="20"
             change="onSelectionChange(event)" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.controls.dataGridClasses.DataGridColumn
            import mx.rpc.events.ResultEvent;
            [Bindable]private var acCombo:ArrayCollection = new ArrayCollection ([{id:1, label:"Private"},{id:2, label:"Public"}]);
            private var _ownerData:Object;
            public function init():void
                //init code
            override public function set data(value:Object):void
                if (value is DataGridColumn ){
                }else
                    super.data = value
            override public function get data():Object
                return _ownerData;
            override public function setFocus():void
                super.setFocus();
                open();
            private function onSelectionChange(e:ListEvent):void
        ]]>
    </mx:Script>
</mx:ComboBox>

Similar Messages

  • Sort DataGrid with ComboBox

    I have a DataGrid with several columns and I would like to be
    able to sort it with a ComboBox. So if option a in the comboBox is
    selected then column A in the DataGrid will be used to sort. I
    option B is selected then a different column wil sort the DataGrid.
    How would I go about this?
    Thanks
    Dave

    "dmschenk" <[email protected]> wrote in
    message
    news:gbe16o$c4p$[email protected]..
    > I have a DataGrid with several columns and I would like
    to be able to sort
    > it
    > with a ComboBox. So if option a in the comboBox is
    selected then column A
    > in
    > the DataGrid will be used to sort. I option B is
    selected then a
    > different
    > column wil sort the DataGrid. How would I go about this?
    I think there's an example of this at
    http://blog.flexexamples.com

  • Silverlight DataGrid with Combobox rendering problem

    As you know that we have already implemented Silverlight application in our application, we need your help to resolve one issue that currently we are facing, actually this is a production bug. We are using Silverligh3 latest version. In our Silverlight
    page we have one data grid and inside that we have one dropdown list as a column and others are textboxes. The dropdown lists are attached with the data context using two way binding. Now in order to simulate the issue, add multiple rows (using front-end ‘Add
    Row’ custom button) on that data grid at runtime so that scrollbar is coming on the data grid, select data from combo boxes from first two rows, and after scrolling up and  down for 2-3times causing combo boxes data disappeared from selected ones and it is
    appearing on rows where no values are selected earlier. But if you reload the page then everything is coming as before. And we have checked that the data context object is purely ok and this is a layout refreshing problem only. I do not know whether this is
    a bug of Silverlight or not, but as this is a production issue, I need your help urgently.

    Thanks for your reply. I have simulated the problem in a test page which I have uploaded in this forum. As per your suggestion I have added the code but I doubt whether I have
    done it properly. Please check the code as after incorporating the StackPanel also it behaves the same way. You will find the source code for Page1.xaml and the Page1.xaml.vb below in this page. Please review and let me know why virtualization is still active. 
    Page1.xaml
    <navigation:Page x:Class="SLClientApp.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    mc:Ignorable="d"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    d:DesignWidth="640" d:DesignHeight="480"
    Title="Page1 Page">
    <Grid x:Name="LayoutRoot">
    <data:DataGrid Margin="18,0,18,18" VirtualizingStackPanel.VirtualizationMode="Standard" x:Name="dtgTestGrid" ItemsSource="{Binding Mode=TwoWay, Path=TestDataCol}" AutoGenerateColumns="False" >
    <data:DataGrid.Columns>
    <data:DataGridTemplateColumn Header="Test Combo">
    <data:DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <ComboBox VirtualizingStackPanel.VirtualizationMode="Standard" Loaded="SetDataForCombo" x:Name="cmbTestCombo" Height="24" Width="120" >
    <ComboBox.ItemsPanel>
    <ItemsPanelTemplate>
    <StackPanel/>
    </ItemsPanelTemplate>
    </ComboBox.ItemsPanel>
    </ComboBox>
    </DataTemplate>
    </data:DataGridTemplateColumn.CellTemplate>
    </data:DataGridTemplateColumn>
    </data:DataGrid.Columns>
    </data:DataGrid>
    </Grid>
    </navigation:Page>
    Page1.xaml.vb
    Imports System.Collections.ObjectModel
    Partial Public Class Page1
    Inherits Page
    Public objTestClassCol As New TestClassCol
    Public Sub New()
    InitializeComponent()
    End Sub
    'Executes when the user navigates to this page.
    Protected Overrides Sub OnNavigatedTo(ByVal e As System.Windows.Navigation.NavigationEventArgs)
    End Sub
    Private Sub SetDataForCombo(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
    For iCount = 1 To 5
    CType(sender, System.Windows.Controls.ComboBox).Items.Add("Value" + CStr(iCount))
    Next iCount
    End Sub
    Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    LayoutRoot.DataContext = objTestClassCol
    For iCount = 1 To 30
    objTestClassCol.TestDataCol.Add(New TestClass)
    Next
    End Sub
    End Class
    Public Class TestClass
    Private strLVTestData As String
    Public Property TestData() As String
    Get
    Return strLVTestData
    End Get
    Set(ByVal value As String)
    strLVTestData = value
    End Set
    End Property
    End Class
    Public Class TestClassCol
    Private objLVTestData As New ObservableCollection(Of TestClass)
    Public Property TestDataCol() As ObservableCollection(Of TestClass)
    Get
    Return objLVTestData
    End Get
    Set(ByVal value As ObservableCollection(Of TestClass))
    objLVTestData = value
    End Set
    End Property
    End Class

  • DataGrid with dynamic comboboxes

    I need to design a dataGrid with comboboxes in one column. These comboboxes should all have different dataProviders based on a value from column 1. What would a general approach be?
    Thanks

    The renderer's data property is the data for the entire row so you can get the column1 data and assign the combobox's dataprovider accordingly.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Custom DataGrid problems with Comboboxes

    I am using a custom datagrid with comboboxes and
    colorpickers. I found this code on the web and adapted it to work
    with my code. The only problem is that if you pull down a combobox
    and then click somewhere outside without selecting anything, it
    seems to erase the data in the dataprovider arraycollection and so
    'value' in the set data method becomes null.

    This is not a bug if I understand you properly. I believe most people would wish anything which is obtained via the tv to be backed up, which is why the content is transferred. If you want it to remain available on the tv you will need to sync it back to it.

  • FB4b1: Datagrid with data driven Combobox

    Hi,
    I would like to implement a datagrid with a datadriven combox in FB4b1.
    The database should store "only" values, but should show a different labeltext in the grid.
    When the users load this Grid the stores values should be uses to set the comboboxes.
    That sounds easy but I haven't found a easy way to implement that!
    1.) I need to overrite the "save column" function, so that the shown labeltext is not saved, but its db-values.
    How can I do this?
    2.) I need to build the combox in the datagrid, but there is nnothing like"combox.value="myValID" ( that would be all in vb.net)
    Do I have to loop manually over the selectedIndex until I found my savedValue?
    Like
    http://www.boyzoid.com/blog/index.cfm/2006/11/22/Flex-Custom-Components-and-Custom-Methods
    Is there an easier way to do this?
    Thanks for any pointers!
    Martin Zach

    Each item in comobobox has a label and a data value associated with it.
    The following should work if you were to access data of a selected combo box item, without looping through the items. If it is a string value then
    mylabel.text = myCombo.selectedItem.data.toString() would show / store the associated data with the combobox item for the label text, you can replace mylabel with the datagrid's dataprovider for your requirements.
    Hope this helps
    -Sunil

  • Bind user generated info to DataGrid & edit with comboboxes

    In my app, the user enters data which gets stored into a
    class. I then wish to display this info in a DataGrid with three
    columns corresponding to the data entered (2 strings and 1 number).
    Is there an easy way to get this into the DataGrid by using binding
    or do I have to do manual insertion of the data?
    Also, I'd like to let the user edit the DataGrid. But I don't
    want him to be able to just type whatever he wants, I'd rather give
    him a pop-up or combobox with the relevant options.
    Any suggestions about this approach?

    When you say the data gets stored in a class, do you mean an
    object? One way would be to store the data in a user data value
    object and then bind the object parameters to your DataGrid. If
    there are multiple users, you could put the object in an
    ArrayCollection and bind that to your DataGrid.
    You could then use an itemRenderer or itemEditor for each
    column that would allow the user to update the values with
    comboBoxes and the updates would be reflected in the stored object.
    Vygo

  • Combobox in Datagrid with different values

    Hi All,
    I have a datagrid. One of the columns in the datagrid is set
    to display a combobox as the ItemRenderer. Now, the data for the
    combobox is different for each row. How do I set up the data
    provider for the combobox in such a scenario.
    For example : I have a collection of Shirt objects.
    public class Shirt {
    public String id;
    public String type;
    public String[] color; //this is an array
    This should be displayed in the datagrid, with the Color
    column rendered as a combobox. The colors will be different for
    each shirt.
    Thanks
    CS

    Yes. Some more detail:
    in the function,
    override public function set data(value:Object): void {
    the "value" parameter will contain a refernce to an entire
    "Shirt" instance.
    So you can assign the comboBox.dataProvider=value.color;
    Now, It is more complicated than this, because you will want
    the combobox to show the correct value for each row, right?
    For this to happen, you will need a selectedColor property on
    Shirt. When the user chooses a color, you will need to update this
    property with the selection.
    Next, your renderer must read the value of selectedColor and
    set the comboBox.selectedIndex.
    If selectedColor contains the *index* of the color then you
    have it easy. If it contains the color name itself, then you will
    have to for-loop over the color array until yom match the
    selectedColor. then you will have the index and can set
    selectedIndex.
    ComboBox does not support setting the value directly. It is
    pretty easy to extend combo to do this. There are several examples
    out there. I posted a link to one on CFLEX.net
    Tracy

  • Datagrid with a datadriven combox

    Hi,
    I would like to implement a datagrid with a datadriven combox.
    The database should store "only" values, but should show a different labeltext in the grid.
    When the users load this Grid the stores values should be uses to set the comboboxes.
    That sounds easy but I haven't found a easy way to implement that!
    1.) I need to overrite the "save column" function of the generated code from FB4b1, so that the shown labeltext is not saved, but its db-values.
    How can I do this?
    2.) I need to build the combox in the datagrid, but there is nnothing like"combox.value="myValID" ( that would be all in vb.net)
    Do I have to loop manually over the selectedIndex until I found my savedValue?
    Like
    http://www.boyzoid.com/blog/index.cfm/2006/11/22/Flex-Custom-Components-and-Custom-Methods
    Is there an easier way to do this?
    Thanks for any pointers!
    Martin Zach

    Hi Martin,
    Couple of questions
    Are you using LCDS as your backend?
    Are you using the Adobe data modeler and deploying your model on to your LCDS server?
    If so, then you could try something called derived properties, which actually do not require a database column and you could compute its value based on the value of a existing column.
    You can find more info about this on
    http://labs.adobe.com/technologies/livecycle_dataservices3/videos/
    http://labs.adobe.com/technologies/livecycle_dataservices3/
    Thanks
    -Sunil

  • Shockwave from a movie the director (8.5) with combobox

    Hello: I want to create a shockwave from a movie the director
    (8.5) with combobox (activex microsoft). Is it possible this
    somehow?.
    Automatic translation of Spanish. I sit(feel) it but
    Englishman does not speak himself.
    Thanks.
    Español: Quiero exportar una pelicula con un combobox
    control activex de (director 8.5) a shockwave para incluirlo en la
    web. Me da un error: no se ha encontrado xtra activex o no se ha
    inicializado bien.
    Gracias

    bertir wrote:
    > Hello: I want to create a shockwave from a movie the
    director (8.5) with
    > combobox (activex microsoft). Is it possible this
    somehow?.
    > Automatic translation of Spanish. I sit(feel) it but
    Englishman does not speak
    > himself.
    > Thanks.
    > Español: Quiero exportar una pelicula con un
    combobox control activex de
    > (director 8.5) a shockwave para incluirlo en la web. Me
    da un error: no se ha
    > encontrado xtra activex o no se ha inicializado bien.
    > Gracias
    >
    >
    You should ask this question on the Lingo forum. This is the
    MUS forum
    and some users may not read it, because MUS is not used by
    many people
    these days.

  • I have a PowerMac G4 running ProTools that no longer boots up.  All I get is a file folder on the screen with a flashing question mark in it.  Ran the Utility disk and all systems passed.  Any ideas?

    I have a PowerMac G4 running ProTools that no longer boots up.  All I get is a file folder on the screen with a flashing question mark in it.  Ran the Utility disk and all systems passed.  Any ideas?

    You need to use the computer's install disks to repair the hard drive or install a new OS.
    (58033)

  • My MBP (mid 09)/ folder with a flashing question mark.

    My MBP (mid 09) is showing a folder with a flashing question mark. I tried the usual things like PRAM Reset and booting with a external drive. I also changed the hard drive and could use it as a external drive on an other Mac - so this seems to work. Another drive could not be used too. The Apple Hardware Test does not work - my Superdrive is broken. Any ideas?

    https://discussions.apple.com/docs/DOC-3046
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents

  • At startup I get grey screen and a folder with a flashing question mark.  How do I reset my MacBook Pro to the manufacture defaults?

    At startup I get grey screen and a folder with a flashing question mark.  How do I reset my MacBook Pro to the manufacture defaults?

    Click here and follow the instructions. If the computer originally shipped with Mac OS X 10.6.8 or earlier, when you reach step 5, insert its original disk, restart with the C key held down, use the Disk Utility to erase the internal drive, and install a fresh OS.
    (113954)

  • Upgraded to ios6 on my iphone 3gs and email is not displaying images. It has a blue box with a blue question mark inside

    I just upgraded to ios 6 on my iphone 3gs and I noticed on a couple of incoming emails that the images and information are not being displayed. There is a blue square box with a blue question mark inside. I already tried to press the home key and power key to restart. The email still does not display correctly. I went on my laptop to retrieve that same email and I was able to see the graphics and information, so the problem is on the iphone. I received two emails like this, so I'm missing all the important information. I also tried to retrieve my email through the internet browser and I still have the same problem. Any suggestions? Thanks!

    I forgot to mention that I have an Ipad 2 also and I can view the email information on there also. I received an email from Party city and it said to click here to print out the coupon. So I click the coupon and there is the little blue box with the question mark. This is the first time I've seen this happen, as I have printed out the coupons before. Maybe it has to do with the IOS6 update, because this just started to happen right after the update.

  • I have replaced my ibook hard drive but when I start up I get a folder with a flashing question mark. I have tried installing the OSX disk using the "C" key but can't get any further than the flashing "?." What do I do? What is the problem?

    I have replaced my ibook hard drive but when I start up I get a folder with a flashing question mark. I have tried installing the OSX disk using the "C" key but can't get any further than the flashing "?." What do I do? What is the problem?

    Which iBook do you have?
    http://support.apple.com/kb/HT1772?viewlocale=en_US
    Which version of the OS is installed, and which version are you trying to install?
    You could try starting up with Startup Manager and see if it will allow you to select the OS X install disc as the startup disk. If so, maybe you can proceed from there. I would recommend repairing the hard drive first since you are evidently having a bit of a problem with it.

Maybe you are looking for