Using itemRenderer in dataGrid?

I wish to restrict user input, to match database type, in a
dataGrid.
I have used an itemRenderer with the 'restrict' property set:
<mx:itemRenderer>
<mx:Component>
<mx:TextInput restrict="0-9."/>
</mx:Component>
</mx:itemRenderer>
to restrict user input to numeric input only.
This does not work. But, if I use the 'restrict' property on
a
textInput outside the dataGrid it does.
What am I doing wrong?

how do i go about doing that?  do i put a change event function in the itemrenderer?  and how would i eventually reference data.col2?

Similar Messages

  • Facing problem with Itemrenderer in Datagrid...

    Hi,
    Any idea how the following code using Action script..
    <mx:DataGridColumn headerText="Online"
    dataField="online">
    <mx:itemRenderer>
    <mx:Component>
    <mx:CheckBox id="chkBox"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    As it is in actionscript....
    I dont want to create seperate component... everything i want
    to write in single file.
    something like...
    var dgc:DataGridColumn=new DataGridColumn();
    var chkBox:CheckBox=new CheckBox();
    Here how to add chkBox to dgc using Itemrenderer??? any
    idea??
    Is its possible???

    I am having the exact same issue! All my components are
    DYNAMICALLY generated with AS3 here is my post:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1344455&enterthread=y
    ALL examples I find or are given involve static components
    which I cannot have!
    I hope someone helps us out.

  • How to use placeSortArrow in datagrids ?

    What is the right way to use placeSortArrow() in dataGrids ?
    The documentation says :" Draw the sortArrow graphic on the
    column that is the current sortIndex."
    But now, how to set the "curernt Sort Index", there is
    actually no property for that.
    I tried also to set an undocumented dataGrid attribute -
    sortColumn - to be the column on which I do the sort, then to call
    placeSortArrow(), but nothing is drawn...
    Does somebody know how to use this function ?
    Thanks

    Try the following:
    const char *nameVal = "русский";
    XmlData data((void *)nameVal, strlen(nameVal));
    XmlQueryContext qc = mgr.createQueryContext();
    XmlValue nodeName(XmlValue::STRING, data);
    qc.setVariableValue("name", nodeName);Lauren Foutz

  • Use ItemRenderer for particular rows in ADG

    I noticed that the itemRenderer is applied column-wise. I was wondering if it is possible to use ItemRenderer only for a few rows in the ADG. I want the itemRenderer to be applied to parent nodes and all their children. But if a row doesn't have children, I don't want it to be renderer by an ItemRenderer. Any idea of how to achieve that? Thanks.

    Yes.  You'll need to use the ADG's rendererProviders property.  It's an array of AdvancedDataGridRendererProviders (http://livedocs.adobe.com/flex/3/langref/mx/controls/advancedDataGridClasses/AdvancedDataG ridRendererProvider.html).  The documentation is pretty good, but basically you set a bunch of properties on each ADGRP, and the grid figures out from those properties what renderers to use on the fly.  Its exactly what you need for different renderers at different levels in a hierarchy.

  • Using a custom itemrenderer in datagrid to update value in the same row but different column/cell

    Here's what I have so far.  I have one datagrid (dg1) with enable drag and another datagrid (dg2) with dropenabled.  Column3 (col3) of dg2 also has a custom intemrenderer that's just a hslider.
    When an item from dg1 is dropped on dg2, a custom popup appears that asks you to use the slider in the popup to set a stress level.  Click ok and dg2 is populated with dg1's item as well as the value you selected from the popup window.  I was also setting a sliderTemp variable that was bound to the itemrender slider to set it but that's obviously causing issues as well where all the itemrenderer sliders will change to the latest value and I don't want that.
    What is needed from this setup is when you click ok from the popup window, the value you choose from the slider goes into dg2 (that's working) AND the intemrenderer slider needs to be set to that value as well.  Then, if you used the intemrenderer slider you can change the numeric value in the adjacent column (col2).   I just dont know how to hook up the itemrenderer slider to correspond with that numeric value (thatds be in col2 on that row);
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"
                        xmlns:viewStackEffects="org.efflex.mx.viewStackEffects.*" backgroundColor="#FFFFFF" creationComplete="init(event)"
                        xmlns:components="components.*" xmlns:local="*">
         <mx:Script>
              <![CDATA[
                   import mx.binding.utils.ChangeWatcher;
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   import mx.controls.TextInput;
                   import mx.core.DragSource;
                   import mx.core.IUIComponent;
                   import mx.events.CloseEvent;
                   import mx.events.DataGridEvent;
                   import mx.events.DragEvent;
                   import mx.events.FlexEvent;
                   import mx.events.ListEvent;
                   import mx.events.SliderEvent;
                   import mx.events.SliderEventClickTarget;
                   import mx.managers.DragManager;
                   import mx.managers.PopUpManager;
                   import mx.utils.ObjectUtil;
                   [Bindable]private var myDP1:ArrayCollection;
                   [Bindable]private var myDP2:ArrayCollection;
                   [Bindable]public var temp:String;
                   [Bindable]public var slideTemp:Number;
                   private var win:Dialog;     
                   protected function init(event:FlexEvent):void{
                        myDP1 = new ArrayCollection([{col1:'Separation from friends and family due to deployment'},{col1:'Combat'},{col1:'Divorce'},{col1:'Marriage'},
                             {col1:'Loss of job'},{col1:'Death of a comrade'},{col1:'Retirement'},{col1:'Pregnancey'},
                             {col1:'Becoming a parent'},{col1:'Injury from an attack'},{col1:'Death of a loved one'},{col1:'Marital separation'},
                             {col1:'Unwanted sexual experience'},{col1:'Other personal injury or illness'}])
                        myDP2 = new ArrayCollection()
                   protected function button1_clickHandler(event:MouseEvent):void
                        event.preventDefault();
                        if(txt.text != "")
                             Alert.yesLabel = "ok";                    
                             Alert.show("", "Enter Stress Level", 3, this,txtClickHandler);
                   private function image_dragEnter(evt:DragEvent):void {
                        var obj:IUIComponent = IUIComponent(evt.currentTarget);
                        DragManager.acceptDragDrop(obj);
                   private function image_dragDrop(evt:DragEvent):void {
                        var item:Object = dg2.selectedItem;                    
                        var idx:int = myDP2.getItemIndex(item);
                        myDP2.removeItemAt(idx);
                   protected function dg1_changeHandler(event:ListEvent):void
                        temp=event.itemRenderer.data.col1;     
                   protected function dg2_dragDropHandler(event:DragEvent):void
                        event.preventDefault();                         
                        dg2.hideDropFeedback(event as DragEvent)
                        var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
                        win.btn.addEventListener(MouseEvent.CLICK, addIt);
                        PopUpManager.centerPopUp(win);                              
                        win.mySlide.addEventListener(Event.CHANGE, slideIt);
                   private function txtClickHandler(event:CloseEvent):void {
                        trace("alert");
                        if (event.detail==Alert.YES){
                             myDP2.addItem({label:temp});
                   private function addIt(event:MouseEvent):void{                    
                        myDP2.addItem({col1:temp, col2:slideTemp})
                   private function slideIt(event:SliderEvent):void{                    
                        slideTemp = event.target.value;               
              ]]>
         </mx:Script>
                   <mx:Panel x="10" y="10" width="906" height="481" layout="absolute">
                        <mx:Image x="812" y="367" source="assets/woofie.png" width="64" height="64" dragDrop="image_dragDrop(event);" dragEnter="image_dragEnter(event);"/>
                        <mx:DataGrid x="14" y="81" width="307" height="251" dragEnabled="true" id="dg1" dataProvider="{myDP1}" wordWrap="true" variableRowHeight="true" change="dg1_changeHandler(event)">
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Examples of Life Events" dataField="col1"/>
                             </mx:columns>
                        </mx:DataGrid>
                        <mx:DataGrid x="329" y="81" height="351" width="475" dragEnabled="true" dropEnabled="true" id="dg2"
                                        wordWrap="true" variableRowHeight="true" dataProvider="{myDP2}" editable="true"
                                        dragDrop="dg2_dragDropHandler(event)"  rowHeight="50" verticalGridLines="false" horizontalGridLines="true" >
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Stressor" dataField="col1" width="300" wordWrap="true" editable="false">
                                  </mx:DataGridColumn>
                                  <mx:DataGridColumn headerText="Stress Level" dataField="col2" width="82" editable="false"/>
                                  <mx:DataGridColumn headerText="Indicator" dataField="col3" width="175" paddingLeft="0" paddingRight="0" wordWrap="true" editable="false">
                                       <mx:itemRenderer>
                                            <mx:Component>
                                                 <components:Compslide/>
                                            </mx:Component>
                                       </mx:itemRenderer>
                                  </mx:DataGridColumn>
                             </mx:columns>
                        </mx:DataGrid>                    
                        <mx:Text x="14" y="10" text="The first category of underlying stressors is called Life Events. The list includes both positive and negative changes that individuals experience. Both can be stressful. For example, becoming a parent is usually viewed as a positive thing, but it also involves many new responsibilities that can cause stress. " width="581" height="73" fontSize="12"/>
                        <mx:TextInput x="10" y="380" width="311" id="txt"/>
                        <mx:Text x="10" y="335" text="Add events to your list that are not represented in the example list.  Type and click &quot;Add to List&quot;&#xa;" width="311" height="51" fontSize="12"/>
                        <mx:Button x="234" y="410" label="Add to List" click="button1_clickHandler(event)"/>
                   </mx:Panel>     
    </mx:Application>

    how do i go about doing that?  do i put a change event function in the itemrenderer?  and how would i eventually reference data.col2?

  • Help using ItemRenderer to show images based on digits in DataGrid model

    Hi there,
    Disclaimer: this is my very first attempt at Flex!
    I found rummaging online, some documentation about
    ItemRenderers. I have a datagrid pulling info from a PHP Ajax
    backend successfully. One of the columns retrieves a digit only (1,
    2, or 3 ).
    I've read that I can create a CellRenderer by creating a
    mxml file for the renderer (StatusRenderer.mxml), adding this to my
    <mx:DataGridColumn specification:
    itemRenderer="StatusRenderer"
    where my StatusRenderer.mxml right now contains only:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="32" height="32">
    </mx:Canvas>
    It displays a blank square as expected.
    so now, how do I make it show images/open.gif,
    images/closed.gif or images/deferred.gif based on status, 1, 2, or
    3 respectively?
    Not sure how actionscript blends into components this way..
    Thanks in advance!
    Alex

    Hi Vikas,
    Thanks for sharing.
    " [Not sure if one technique has any performance advantages over the other]"It seems to me that in your technique it should be simpler to maintain several gif options – editing LOV seems simpler then editing the DECODE parameters list. I'm also thinking about the option of using dynamic LOV for gifs stored in a table.
    Regards,
    Arie.

  • How to get selected values (using checkBox) from DataGrid in flex.

    i have a datagrid which is getting values from a XML file (getting this xml file from database using PHP and HTTP request in flex). i have created a checkbox in every row in data grid. and here is my requirement: i want to select tow or three check-box and would like to get all the values form that particular ROWs in some form , prefered arraycollection (such that i can pass this array directly to a bar chart) .. can some one help me as i am new to flex .
    code ......
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="siteData.send()">
              <mx:Script>
                        <![CDATA[
                                  import mx.collections.XMLListCollection;
                                  import mx.controls.*;
                                  import mx.events.ListEvent;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.controls.Alert;
                                  [Bindable] private var fullXML:XMLList;
                                  private function contentHandler(evt:ResultEvent):void{
                                            fullXML = evt.result.values;
                        ]]>
              </mx:Script>
              <mx:VBox>
                        <mx:Label text="This Data Grid is loading the full XML file"/>
                        <mx:DataGrid width="600"  id="datagrid" dataProvider="{fullXML}">
                                  <mx:columns>
                                            <mx:DataGridColumn headerText="Select">
                                                      <mx:itemRenderer>
                                                                <mx:Component>
                                                                          <mx:HBox horizontalAlign="center">
                                                                                    <mx:CheckBox id="check"/>
                                                                          </mx:HBox>
                                                                </mx:Component>
                                                      </mx:itemRenderer>
                                            </mx:DataGridColumn>
                                            <mx:DataGridColumn dataField="release_version" headerText="Release"/>
                                            <mx:DataGridColumn dataField="build" headerText="build"/>
                                            <mx:DataGridColumn dataField="time_login" headerText="time_login"/>
                                            <mx:DataGridColumn dataField="time_tunnel" headerText="time_tunnel"/>
                                            <mx:DataGridColumn dataField="rate_login" headerText="time_tunnel"/>
                                            <mx:DataGridColumn dataField="rate_tunnel" headerText="rate_tunnel"/>
                                  </mx:columns>
                        </mx:DataGrid>
              </mx:VBox>
              <mx:HTTPService url="http://localhost/php_genxml.php" id="siteData" result="contentHandler(event)" resultFormat="e4x"/>
    </mx:Application>
    as you can see in the image , i will get this datgrid . now i want to select two or three checkboxes and would like to get all the values form the perticular row (for which check box is selected). i would like to get in array from such that i can driectly pass them to bar chart....
    can some one help me in this. as i m new to flex. or if you have some other suggestion ...My final requirement is: select some values and generate bar gharph for those values.
    please help me in this.
    thanks
    tanuj

    Hi Timo -
    Thanks for the suggestion. I could get the values as below:
    public void multiOpUnitValChange(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding opUnitIter = (DCIteratorBinding)bindings.get("OperatingUnit2VOIterator");
    Integer[] values = (Integer[])valueChangeEvent.getNewValue();
    for (int i=0; i<values.length; i++){
    Row row = opUnitIter.getRowAtRangeIndex(i);
    System.out.println(row.getAttribute("OpUnitId"));
    Thanks -
    Rohit

  • ItemRenderer and DataGrid Problem

    Hi guys.
    I'm on creating a small app that simply pulls information
    from an XML file, displays it in a DataGrid then allows the user to
    filter and search it. First things first though; I'll explain what
    I have so far then detail my problem.
    I get the XML file via HTTPService then place the results in
    a Bindable ArrayCollection. When the Datagrid's source is set to
    that ArrayCollection it works fine. What I am initially trying to
    do is use an itemRenderer in one of the columns that displays lines
    of text depending on the values of the current row.
    For example, the structure of my XML file is (roughly):
    <content>
    <name>Name1</name>
    <description>Description Goes Here</description>
    <audience1>yes</audience1>
    <audience2>no</audience2>
    <audience3>yes</audience3>
    </content>
    So what I am trying to do is group the audiences that each
    piece of "content" has a yes value to. So under the "Audiences"
    column in the datagrid, the above content would say
    "Audience1
    Audience3"
    as it has a yes value in between audience 1 and 3. I've tried
    writing very basic code within the itemRenderer whereby I override
    the public function set data and do some checks there but it never
    seems to work right. I've tried using Arrays within that to store
    the current audiences but I clearly haven't got the right format
    for that.
    There must be a more efficient way of doing this. I'm fairly
    new to both Flex and AS3 (been using AS2 quite a while now) but I
    have a feeling there would be some way to store each row's audience
    list in an array/object/model so I can refer to it later (I'm
    intending to filter these results by audience type later so I think
    I will HAVE to do it this way eventually). I've read quite a few
    tutorials and guides but I honestly don't know where to look
    anymore, none of them seem to cover this specific problem.
    I hope this makes sense to you guys and any guidance you
    could give me would be greatly appreciated.
    Cheers

    LabelFunction produces a display-only column.
    To filter, you will need to use the underlying data.
    Another solution to consider is to create a custom item
    class. Loop over the xmllist and build instances of the class,
    populating the properties from the xml.
    have a property who's value is calculated based on the
    audience properties values. Since it is a "real" data property in
    each item, you can filter on it directly.
    Tracy

  • ItemRenderer for DataGrid

    Here's a nice problem
    Please test the code below.
    As you will see, it works fine! The scores (7) are presented neatly. That's because in the itemRenderer for column 2, I bind the text property to
    data.item2.score.
    BUT
    In my application, I DON'T KNOW WHAT THIS PROPERTY WILL BE because the dataProvider is generated dynamically. The names of the properties are generated dynamically using a prefix ("item") and a suffix which is an id from the database. So the dataProvider could hold the props 'item325' and 'item23' and so on...
    What I want to do is to store the name of the property in the labelField of the column (as I did in the example). The itemRenderer should now get its data using that labelField.
    In my ItemRenderer which says now 'text="{data.item2.score}"' should be 'text="{data[referenceToLabelField].score}"'
    Any Ideas?
    thx;
    d
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]
                private var dp:ArrayCollection = new ArrayCollection();
                private function init():void
                    var a:Array = new Array();
                    for (var i:int = 0; i < 10; i++)
                        a.push({pupil: "Pupil " + i, item2: {score: 7}});
                    dp.source = a;
            ]]>
        </mx:Script>
        <mx:DataGrid dataProvider="{dp}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="pupil" width="200"/>
                <mx:DataGridColumn headerText="Column 2" dataField="item2" width="200">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:Label text="{data.item2.score}" width="10"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>

    The project I'm working on is a school test generator. I created a test generator. Let's say I create a test named "Final exam". In this test I link a student group and I add as much testItems as I want. Let's say I make 2 testItems named "Written result" and "Attendance during schoolyear". Now, my application will generate scores for each student and for each item.
    We'll generate a dataGrid as:
                        Written result          Attendance during schoolyear
    Pupil 1               7                                   5
    Pupil 2               6                                   9
    Pupil 3               8                                   2
    In this simple example, my dataProvider could look like this:
    {pupil: "Pupil 1", score1: 7, score2: 5},
    {pupil: "Pupil 2", score1: 6, score2: 9},
    {pupil: "Pupil 3", score1: 8, score2: 2}
    Setting the labelField to 'score1' and 'score2' will work.
    So far, so good! My problem however is that the scores are not just figures but Objects! Why? Because my system makes it possible to VIEW the scores in diffrent ways, such as figures, smileys, checkboxes etc. The diffrent columns in my grid will each have a diffrent itemRenderer. The itemRenderers will take properties from their dataObject to render the output. My dataProvider looks like:
    {pupil: "Pupil 1", score1: {score: 7, foo: 'whatever'}, score2: {score: 5, foo: 'whatever'}},
    {pupil: "Pupil 2", score1: {score: 6, foo: 'whatever'}, score2: {score: 9, foo: 'whatever'}},
    {pupil: "Pupil 3", score1: {score: 8, foo: 'whatever'}, score2: {score: 2, foo: 'whatever'}}
    Setting the labelField to 'score1' and 'score2' won't work!
    The data property for the itemRenderer of column 2 should be
         {score: 7, foo: 'whatever'}
    instead of
         {pupil: "Pupil 1", score1: {score: 7, foo: 'whatever'}, score2: {score: 5, foo: 'whatever'}}
    Does that make things clearer?
    Thx,
    d

  • Question about Using States in DataGrid Item Renderer

    I have a DataGridColumn with an ItemRenderer that extends the
    Box component. The default display is a Text component. When the
    user clicks on the text component, I change the State to add a
    PopUpMenuButton child, and make the Text component invisible. This
    works fine. However, I only want to allow one PopUpMenuButton to be
    visible in the DataGrid at a time (similar to how an itemEditor
    works). I don't want to use an itemEditor, because I've run into
    too many problems trying to get that to work in this instance.
    I am implementing IDropInListItemRenderer in my itemRenderer,
    in order to access the listData property, which will give me the
    owner (DataGrid), but I don't know how to "turn off" the "editing"
    state in other itemRenderers in the DataGrid.
    How can I accomplish this?
    Thanks.

    Here we go. I simply added an Listener for Change Events in
    the listData.owner - if it is triggered, i update the currentState
    to null. Works like a charm. Much easier than trying to access the
    itemRenderers in the column and resetting them all. Better on
    performance too.

  • Proper URL for LinkButton in itemRenderer within datagrid

    I am having problems figuring out the best way to open a URL
    using the LinkButton function within an itemRenderer under a
    DataGridColumn. I use a HTTPService to call a PHP script to pull
    data from a MySQL database. The datagrid fills in properly and all
    the data is being displayed. The link button works in that it will
    open a new browser (if I put in a fake URL without my required
    data).
    Below is an example of my column with the link button and the
    URL I'm tring to open.
    <mx:DataGridColumn headerText="Script ID"
    dataField="scriptid">
    <mx:itemRenderer>
    <mx:Component>
    <mx:LinkButton label="{data.scriptid}"
    click="navigateToURL(new URLRequest('
    http://remoteurl/index.php?file=ext&id='data.scriptid),
    '_blank')"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    The error that I get is this:
    The reference to entity "id" must end with the ';' delimiter.
    It's like Flex Builder thinks that the "id" in the URL is a
    parameter for the control? I tried enclosing the data.scriptid
    within the single quotes. I also tried putting curly brackets {}
    around data.scriptid as well.
    Any assistance would be appreciated.
    Thanks,
    Chris

    Spark DataGrid or MX DataGrid?

  • Fire itemrenderer in datagrid

    Hi All,
    I am adding a row in my datagrid dynamically using an external button but couple columns contain a combo box as itemrenderer.
    The first item (index 0) in my comboBox have option "---select---".
    How can I set this first index for both comboBox item renderers after I add the new row?
    Thanks

    Hello RootSounds,
    Good to hear from you again. Well yes, your understanding is correct.
    How do i do that?
    Bo

  • Using itemRenderer in Dynamic Grid

    Hi,
    I have grid with takes in a ArrayCollection as dataProvider.
    Also the columns of the datagrid is defined from the action script.
    At the mxml level, I have only the DataGrid tag. Now my data
    contains some severity levels - critical, moderate and ok. Based on
    what comes in, I want an itemRenderer which will print a different
    image for each severity. i.e. if the value is critial, i want a red
    color icon to be shown in the cell.
    I wish to do this with actionscript itself. I am stuck at the
    itemRenderer part. I checked out the examples. All of them work
    with mxml tags for itemRenderer using images. I want the renderer
    to be through actionscript. Has anyone done this? Can anybody help
    me with this?
    Cheers,
    Uday

    Hi Uday,
    Were you ever able to accomplish this? I'm looking to do
    something almost exactly the same, where I have data that provides
    one of two values, and I want to translate those values into one of
    two icons.
    If you were able to do this, I'd appreciate any explanatory
    help. Or if someone else out there has an answer to his original
    post, I'm sure it would be appreciated by more than just myself.
    Thanks,
    Josh

  • Validation of user inputs when using ItemRenderers in DataGrid

    Hi,
    I have to show multiple editable columns in a DataGrid.
    The columns may have different formats and datatypes e.g.
    numbers, dates, string etc.
    So I am using TextInput/DateField as a ItemRenderer inside
    the DataGrid. I have also set the rendererIsEditor="true".
    Now I want to apply validation to all these editable columns
    depending on their datatypes.
    I know I can do that by applying validators individually on
    each column.
    But is there a way I can use common validation for all the
    columns that have a similar datatype or that have the same
    renderer?

    You can use the itemEditEnd Event of the DataGrid for your
    validation. Then you can use Actionscript to make sure what the
    user enters is in the right format. Example:
    <mx:Script>
    <![CDATA[
    import mx.events.DataGridEvent;
    public function processEdit(event:DataGridEvent):void {
    cellValue =
    TextInput(event.currentTarget.itemEditorInstance).text; // the
    entered text
    cell = event.dataField; //the datafield attribute of the
    column
    // Determine if the new value is too long for nvarchar field
    if(cell == 'WLNET' && cellValue.length > 35) {
    cellValue = cellValue.substr(0,35); //shortening it for user
    demonstrates expected length
    TextInput(event.currentTarget.itemEditorInstance).text =
    cellValue;
    event.preventDefault(); // Prevent the user from removing
    focus, and leave the cell editor open.
    // Write a message to the errorString property.
    // This message appears when the user mouses over the
    editor.
    TextInput(event.currentTarget.itemEditorInstance).errorString="Entered
    text too long.";
    return;
    ]]>
    </mx:Script>
    <mx:DataGrid id="enrolled_dg" editable="true"
    itemEditEnd="processEdit(event);">
    I learned part of this from the Flex documentation online:
    Determining
    the reason for an itemEditEnd event

  • Dynamic setting of itemRenderer in datagrid

    Can we dynamically set the itemrenderer in a datagrid
    depending upon some value in data?

    HI,
    how about to display different controls in a rows for that column? Can it be done?
    Thanks,,
    -jenue

Maybe you are looking for

  • MacBook-Random Shutdowns After Update

    (Note: I posted that I had solved this problem by deleting an older version of Microsoft Office, but a day later the problem resurfaced) 1st Indication of a Problem-- While using "Software Update" to upgrade from 10.4.8 to 10.4.9, the computer screen

  • Photoshop CS2 denying administrative privileges

    I just installed Photoshop CS2 on Windows Vista and registered it using my serial number, but when I open the program to use it, a window pops up telling me "You are not allowed to continue because your account does not have the proper privileges. Pl

  • How to reduce folio file size

    This is a quote from the Adobe support pages: Default Image Format Choose a default option for the folio. Individual articles can have different Image Format settings. Choose Automatic if you want to let InDesign determine whether to export the pages

  • Remittance of Service tax on GTA

    hi, How to create remittance challan for Service Tax on GTA? What is the TCode for the same? Thanks, Maulik Maniyar

  • Ralink WLAN will not install

    I have tried every HP download to reinstall my wireless driver Ralink WLAN. I have even done a full restore of the computer. The WLAN does not show up under network adapters and I have even tried to download by recovery manager(hardware). The HP down