Creating varying number of datagrid columns is fairly straightforward. Datagrid will by itself draw the columns if you do  not specify the <mx:DataGridColumn .../> in your code. The columns will be created according to the properties that each dataProvider object contains. For displaying an icon on the header, you will have to extend the datagrid control and do some tweaks.

Thanks


On 10/16/06, Aaron West <[EMAIL PROTECTED]> wrote:

No problem jelentz, check out the link I've provided below. While you
are looking to dynamically set the dataProvider of a DataGrid the
content
of the article discusses a ComboBox. The takeaway from the article is
how to create your own custom DataGrid class (by extending DataGrid)
and then writing the appropriate code to manipulate the dataProvider.
The article does a good job explain this.

http://thesourcecode.org/?p=15

Let me know if you have questions (note, I didn't write the article.)

| Aaron West
| aaron AT trajiklyhip DOT com
| http://www.trajiklyhip.com/blog/
| Certified Advanced Adobe ColdFusion MX 7 Developer
| Certified Macromedia FlashMX Developer
| Adobe Community Expert

On Oct 14, 2006, at 12:20 PM, jlentz2112 wrote:

> Thanks for the reply, but unfortunately I don't follow all of it. I'm
> new to Flex, so could you please explain more? I get the AS3
> extending DataGrid. How can you dynamically set the dataProvider to
> pass in info to the headerRenderer? A small snippet of code would be
> greatly appreciated.
>
> Thanks again,
> jelentz
> --- In [email protected], Aaron West <[EMAIL PROTECTED]> wrote:
>>
>> jelentz,
>>
>> Based on my limited experience I would suggest creating a custom
>> AS3 class that extends DataGrid. You can then dynamically set the
>> dataProvider, loop through whatever part of the data provider you
>> need, and based on the values therein create the number of
>> data grid columns you need.
>>
>>
>> | Aaron West
>> | aaron AT trajiklyhip DOT com
>> | http://www.trajiklyhip.com/blog/
>> | Certified Advanced Adobe ColdFusion MX 7 Developer
>> | Certified Macromedia FlashMX Developer
>> | Adobe Community Expert
>>
>>
>> On Oct 13, 2006, at 8:40 PM, jlentz2112 wrote:
>>
>>> Hi,
>>>
>>> I've got an app where I need a DataGrid that will have a varying
>>> number of columns based on the value from a database query. I also
>>> need to be able to have each column header display a couple of images
>>> and the text provided by the database query. Is there a way to use a
>>> dataprovider to create a varying number of columns, and to use the
>>> dataprovider to pass in images and text? I've looked for examples
>>> and
>>> haven't had much luck finding any that I could follow. A simplified
>>> explanation would be greatly appreciated.
>>>
>>> Thank you,
>>>
>>> jelentz
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Flexcoders Mailing List
>>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>>> Search Archives:
>>> http://www.mail-archive.com/flexcoders%40yahoogroups.com
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to