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

  • Home
  • SEARCH
  • 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 840055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:33:50+00:00 2026-05-15T05:33:50+00:00

I have this datagrid which has columns with a NumericStepper as an itemEditor where

  • 0

I have this datagrid which has columns with a NumericStepper as an itemEditor where the user can change the number of items he wants to buy. How can I calculate the sum of all cells when the user updates datagrid’s values?

EDIT 1

My datagrid is about colors and sizes of a product. The columns are generated dynamically from this function

private function  getColumn(dataField:String, headerText:String,editable:Boolean) : DataGridColumn
 {
  var column:DataGridColumn = new DataGridColumn(dataField);
  column.headerText = headerText;
  column.width = 20;
  editable ? column.editable = true : column.editable = false;
  column.editorDataField = "value";
  column.itemEditor = new ClassFactory(ColorSizesFormRenderer);
  return column;
 }

and then I loop my xml http result

for each (var thisSize:XML in result.product.(@id == pId)..size) {
           _columns.push(getColumn("size"+thisSize,thisSize,true));
}

So how can I find the sum of all cells?

EDIT 2

I use this code to loop all my cells

protected function color_sizes_itemFocusOutHandler(event:DataGridEvent):void
 {
  total = 0;
  for each(var row:Object in color_sizes.dataProvider) {
     total += row.size28;
  }
 }

the row.size28 is generated dynamically. So it could be row.size29,row.size30 etc.

How can I loop through all my cells without knowing their data.property?

Thanks in advance

  • 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-15T05:33:50+00:00Added an answer on May 15, 2026 at 5:33 am

    Your numeric stepper should show a bindable property value from the [data] row you display.
    Then you just parse the dataProvider of the datagrid and make the sum of that data.property.

    for ex:

    class MyObject 
    {
        [Bindable]
        var itemsNo:int = 0;
        var productName:String = ""; 
    }
    

    The datagrid will have a NumericStepper custom column that will take the value of {data.itemsNo}

    At the end just count all itemsNo from the datagrid.dataProvider items

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

Sidebar

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.