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:

  1. How to hide blank columns in datagrid?
  2. datagrid link out to different state
  3. Datagrid click change state
  4. About how to construct dynamic DataGrid
  5. Datagrid columns widths

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD