Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-01-2005, 12:21 PM   #1
Registered User
Join Date: May 2005
Posts: 6
Default Adding data to a blank datagrid

I have a Datagrid that is populated via a Web Service.

When the database the Web Service is retrieving data from is blank then the Datagrid is blank.

I have successfully configured the datagrid to add records to a database containing data but unfortunately cannot do the same
when the datagrid is blank.

To add new records I am using one input field for each column of the datagrid.

Any assistance is greatly appreciated.

Kind Regards,
DekaFlash is offline   Reply With Quote
Old 11-13-2005, 10:43 PM   #2
total newbie
dex002's Avatar
Join Date: Mar 2005
Location: Australia
Posts: 126

Hi Boulent,

This is how I construct a datagrid and populate it from my web service. Hope it helps:

//this is what happens when the webservice returns successfully
function getStoriesGood(re:ResultEvent):Void{
//create array
	var storiesDP:Array=new Array();
//loop over web service results
for (var i=0; i<re.result.length; i++){
// and add results to array
storiesDP.addItem({StoryID:i,Headline:re.result[i].HEADLINE, Story:re.result[i].STORY, Posted:re.result[i].STORY_DATE})
//create datagrid object and set properties
	section_mc.form_mc.createObject("DataGrid", "stories_dg");
	section_mc.form_mc.stories_dg._x = leftAlign;
	section_mc.form_mc.stories_dg._y = topAlign+50;
	section_mc.form_mc.stories_dg.multipleSelection = false;
	section_mc.form_mc.stories_dg.setSize(500, 350);
//tell datagrid to get data from array
	section_mc.form_mc.stories_dg.dataProvider = storiesDP;
	section_mc.form_mc.stories_dg.sortItemsBy("StoryID", "ASC");
dex002 is offline   Reply With Quote
Old 01-03-2008, 03:24 AM   #3
Registered User
Join Date: Jan 2008
Posts: 2

hi I want to make a datagrid where by clciking a filed I can input data also . ow to do that?
one way is editable="true" but that will enable for all rows & columns . I want to do it for selected columns only . and I want to disable clicking

Last edited by suzanne_khan; 01-03-2008 at 03:45 AM. Reason: more info
suzanne_khan is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:51 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.