Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 545863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:48:24+00:00 2026-05-13T10:48:24+00:00

I want my checkbox — which is in a datagrid, to be selected when

  • 0

I want my checkbox — which is in a datagrid, to be selected when the row of the datagrid is selected. And for this I wrote the following code:

<mx:DataGrid id="dg_trashContent" allowMultipleSelection="true"
                         verticalGridLines="true"
                         dataProvider="{trashDataProvider}"                      
                         width="100%"                        
                         height="240"
                         fontFamily="Arial" y="23"
                         selectable="true"> 
        <mx:columns>
            <mx:DataGridColumn id="col0"
                                textAlign="left"
                                sortable="false"
                                headerText=""
                                headerStyleName="datagridHeader"
                                dataField="name"
                                width="20">
                        <mx:itemRenderer> 
                                <mx:Component> 
                                        <mx:VBox paddingLeft="5"> 
                                                <mx:CheckBox  selected="{data.isRowSelected}" 
                                                            click="outerDocument.updateSelectedRowFlag(event);" 
                                                            change="{this.selected = data.isRowselected; }"/> 
                                        </mx:VBox> 
                                </mx:Component> 
                        </mx:itemRenderer> 
                </mx:DataGridColumn> 
            <mx:DataGridColumn id="col1"
                                textAlign="left"
                                sortable="true"
                                headerText="Name"
                                headerStyleName="datagridHeader"
                                dataField="name"/>

But I get an error for “selected” property that i used in my checkBox. the error says :
Access of possibly undefined property selected through a reference with static type TrashContainer_inlineComponent1.

Could you plz see what am I doing wrong here.

Regards
Zeeshan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:48:25+00:00Added an answer on May 13, 2026 at 10:48 am

    You can use this renderer

    <mx:DataGridColumn id="col0" 
                                textAlign="left" 
                                sortable="false" 
                                headerText="" 
                                dataField="key" 
                                width="20"> 
                        <mx:itemRenderer>  
                                <mx:Component>  
    
                                        <mx:VBox paddingLeft="5">  
                                        <mx:Script>
                                            <![CDATA[
                                                import mx.controls.DataGrid;
    
                                                override public function set data(value:Object):void
                                                {
                                                    super.data = value;
                                                    ckb.selected = data.isRowSelected;
    
                                                    if(data.isRowSelected)
                                                        (parent.parent as DataGrid).selectedItem = data;
                                                }
                                            ]]>
                                        </mx:Script>
                                                <mx:CheckBox id="ckb" />
                                        </mx:VBox>  
                                </mx:Component>  
                        </mx:itemRenderer>  
                </mx:DataGridColumn>  
    

    where isRowSelected is part of the data object in the collection.

    I hope that can be usefull.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following code to create a checkbox. I want the checkbox
I want insert following checkbox in a row from database table, but have error,
I want to have a checkbox for terms and conditions, label of which should
I want to create a table structure with checkbox for each row and each
I have a dynamic DataGrid in which one of the columns is a CheckBox.
I want to use checkbox in my detail view for the bit true or
I've got this code which basically loops through a set of folders and subfolders
I want to build checkbox which get cursor from getLang() if KEY_ACT of language
Possible Duplicate: Delete values selected using checkbox I want to delete records that has
I'm changing checkbox status this way: $(this).attr(checked, 'checked'); After this I want to receive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.