Update a single cell value in datagrid

I want to update a single cell value in a datagrid, is this possible?

here is the code from adobe for replaceItemAt example:

my_dg.setSize(140, 100);
my_dg.move(10, 40);

replace_button.move(10, 10);

// Set up sample data.
var myDP_array:Array = new Array();
myDP_array.push({name:"Clark", score:3135});
myDP_array.push({name:"Bruce", score:403});
myDP_array.push({name:"Peter", score:25});
my_dg.dataProvider = myDP_array;

// Create listener object.
var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
 //Replace previous value
 var prevValue_obj:Object = my_dg.replaceItemAt(2, {name:"Frank", score:949});
 my_dg.selectedIndex = 2;
};
// Add button listener.
replace_button.addEventListener("click", buttonListener);

this is a simple example, what I want to do is just replace the score with out doing anything to the name, something like:

var prevValue_obj:Object = my_dg.replaceItemAt(2, {score:949});

or

var prevValue_obj:Object = my_dg.replaceItemAt(2, score, 949);

I know I can get the whole row of cells data and updated each cell with the replace but I have 15 + columns and want to know if there is a way to update just the data in a single cell without processing data for every cell in that row....

thnaks
 
twall73Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Antonio EstradaTech Leader / Senior Web DeveloperCommented:
Try the following:

<code>

-V
my_dg.setSize(140, 100);
my_dg.move(10, 40);

replace_button.move(10, 10);

// Set up sample data.
var myDP_array:Array = new Array();
myDP_array.push({name:"Clark", score:3135});
myDP_array.push({name:"Bruce", score:403});
myDP_array.push({name:"Peter", score:25});
my_dg.dataProvider = myDP_array;

// Create listener object.
var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
 //Replace previous value
 var prevValue_obj:Object = my_dg.getItemAt(2);
 prevValue_obj.score = 949;
 my_dg.removeItemAt(2);
 my_dg.addItemAt(2, prevValue_obj);
 my_dg.selectedIndex = 2;
};
// Add button listener.
replace_button.addEventListener("click", buttonListener);

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
twall73Author Commented:
Perfect - spot on, works perfectly. Thank You
0
Antonio EstradaTech Leader / Senior Web DeveloperCommented:
Glad to help :)

-V
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.