0
votes

Is there a way to check if flex datagrid column is empty or not? I tried to search for a DataGridColumn that would allow me to that but I couldn't find any.

1
Empty?? your question is not really clear. Please clarify - Pranav Hosangadi
@PranavHosangadi I mean by empty that it contains no data... - Mansuro

1 Answers

3
votes

If you mean to say that the value of that GridColumn is null for all rows then this snippet should work:

//myDG is the datagrid
var allNull:Boolean=true;
for each(var o:Object in myDG.dataProvider) {
    if(o.myColumnName != null) {
        allNull=false;
        break;
    }
}

trace(allNull); //false = all is not null, true = everything in that column is null