Hi,
I have a datagrid nicely populated with data.
But I have some colums which are blank (the columns have a
Header but the rest of its rows are blank).
I want to hide these columns so that users can’t see them.
Note that the blank columns are not fixed. Sometimes it can
be that a column is blank but at other times it can be filled.
So I cannot use… “<… visible=false>
I need to loop thru the columns and then hide the blank
columns.
Anyone has an idea how to code for this loop.
Thx
|||
Well..from what i know, the datagrid supports the syntax to
allow for you to specify the columns explicitly through the
DataGridColumn. Done like this
<mx:datagrid>
<mx:columns>
<mxdatagridcolumn datafield = “Column 1 name” ..>
<mxdatagridcolumn datafield = “” ..>
<mxdatagridcolumn datafield = “” ..>
</mx:columns>
</mx:datagrid>
why dont you specify the columns you want using this. that
way, if there is no data in the colums, that column just wont show.
Hope i am understanding you right when you say hide blank
columns|||
Unfortunately I can’t do what u proposed.
I definitely need to loop thru columns and hide unpopulated
ones.
Any idea how to loop thru columns in a datagrid?
thx|||
Use the “columns” array to loop over the columns.
Set column.visible = false.
I think that’s all yo need to do.
Tracy
Related posts:
- How to hide blank columns in datagrid?
- datagrid link out to different state
- Datagrid click change state
- About how to construct dynamic DataGrid
- Datagrid columns widths
Related posts brought to you by Yet Another Related Posts Plugin.