5/26/2010 11:18:34 AM
Title:
datagrid (urgent)
Hi,
I have a datagrid, I get the data from the database. In my datagrid have the columns like
MyDataGrid
Title , Status
Rama 1
krishna 0
Venki 1
yyyy 0
This data i will get the data from the database.
My Question is i want to display the data instead of Status like 0 - ---> InActive
1 -------> Active
I want the MyDataGrid result
Title , Status
Rama Active
krishna Inactive
Venki Active
yyyy Inactive
Please help me,
Thanks
Inder
Points: 2980
Posts:0
5/26/2010 11:55:03 AM
use this actionscript 3.0 function to update the status field of DataGrid in flex depending upon its value 0 or 1
//use this method to update Status field , "dataGrid" is the datagrid ID, update with your
protected function updateStatus():void
{
dataGrid.setRowBackgroundColor(3,0xffeeee);
for(var i:int;i<dataGrid.dataProvider.length;i++){
if(dataGrid.dataProvider[i].Status==0){
dataGrid.dataProvider[i].Status ="InActive";
}else{
dataGrid.dataProvider[i].Status ="Active";
}
}
dataGrid.dataProvider.refresh();
}
5/26/2010 6:50:59 PM
Hi Inder,
Where Can i write the updateStatus method?
Inder
Points: 2980
Posts:0
5/26/2010 10:39:51 PM
you can write that after you populate your datagrid, I mean when you set its dataprovider.