2 Replies Latest reply on Jul 6, 2007 6:43 PM by nano8

    How to set  headerText in DataGrids through ActionScript

    nano8
      Any help or suggestions with this appreciated. I'm populating a datagrid control in Flex 2 with dynamically data. The number of columns and column names aren't fixed. The column data itself is just raw values; no field names or other elements to identify what the column header should be.

      So when the data provider updates I need to be able to tweak/add the headerText for the columns. How do I access this setting through actionscript? I see many examples for defining <mx.DataGridcolumn> and properties, but I can't really do it that statically in advance; I don't know the column count or type of columns until runtime.

      Is it possible to access the headerText property with something like dataGridID.column[0].DataGridColumn.headerText = ""? This is what I'm looking for, the ability to iterate through and set the headerText, but I haven't found the magic incantation.

      Thanks!