The following example shows how you can remove the header separator skin on the Flex DataGrid control by setting the headerSeparatorSkin style.
Full code after the jump.
Continue reading ‘Removing the header separator on the DataGrid control in Flex’
In a previous example, “Auto-scrolling a TextArea control in Flex”, we saw how you can auto-scroll a Flex TextArea control when new content is added by setting the verticalScrollPosition property to the value of the maxVerticalScrollPosition property.
The following example shows how you can auto-scroll a Flex DataGrid control using the ArrayCollection object’s collectionChange event, and the verticalScrollPosition and maxVerticalScrollPosition properties
Full code after the jump.
Continue reading ‘Creating an auto-scrolling DataGrid control in Flex’
The following example shows how you can set the text color of a Flex DataGrid control’s column header text by setting the headerStyleName and color styles.
Full code after the jump.
Continue reading ‘Setting the column header text color on a DataGrid control in Flex’
The following example shows how you can set the header colors on a Flex DataGrid control by setting the headerColors style to an array of two colors to use for the background gradient.
Full code after the jump.
Continue reading ‘Setting the header colors on the DataGrid control in Flex’
The following example shows how you can determine when the data provider of a Flex DataGrid control changes by listening for the collectionChange event (using the CollectionEvent.COLLECTION_CHANGE constant).
Full code after the jump.
Continue reading ‘Detecting when the data provider of a DataGrid control changes in Flex’
The following example shows how you can display dynamically loaded XML data (with namespaces) in a Flex DataGrid control.
Full code after the jump.
Continue reading ‘Displaying dynamically loaded XML in a DataGrid control in Flex’
The following example shows how you can use an XML object as a data provider for a Flex DataGrid control and use a custom label function to display the XML node’s name.
Full code after the jump.
Continue reading ‘Setting a DataGrid control’s data provider to an XML object in Flex’
In a previous example, “Aligning the header text in a DataGrid column in Flex”, we saw how you could set the text alignment on a Flex DataGrid control’s DataGridColumn by setting the headerStyleName and textAlign styles.
The following example shows a few more methods of aligning data and headers in a DataGrid and individual DataGrid columns by setting a combination of the headerStyleName and textAlign styles on the DataGrid and DataGridColumn instances.
Full code after the jump.
Continue reading ‘Aligning the header text in a DataGrid column in Flex (redux)’
The following example shows how you can set alternating column background colors on a Flex DataGrid control by setting the backgroundColor style for each DataGridColumn object.
Full code after the jump.
Continue reading ‘Setting background colors on a DataGrid column in Flex’
The following example shows how you can set the text alignment on a Flex DataGrid control’s DataGridColumn by setting the headerStyleName and textAlign styles.
Full code after the jump.
Continue reading ‘Aligning the header text in a DataGrid column in Flex’
The following example shows how you can toggle word wrapping on a Flex DataGrid control’s DataGridColumn by setting the headerWordWrap property.
Full code after the jump.
Continue reading ‘Toggling word wrap on a DataGrid column header in Flex’
In a previous example, “Using a CheckBox to filter items in a DataGrid in Flex”, we saw how to filter the items in a Flex DataGrid control based on whether the user selected a CheckBox control or not.
The following example shows how you can filter items in a Flex DataGrid control using an HSlider control, and the ArrayCollection class’s filterFunction property.
Full code after the jump.
Continue reading ‘Using a Slider to filter items in a DataGrid control in Flex’
The following example shows how you can set the horizontal scrollbar policy on a Flex DataGrid control by setting the horizontalScrollPolicy property to one of the constants in the mx.core.ScrollPolicy class.
Full code after the jump.
Continue reading ‘Setting the horizontal scrollbar policy on a DataGrid control in Flex’
The following example shows how you can set the header height on a Flex DataGrid control by setting the headerHeight property.
Full code after the jump.
Continue reading ‘Setting the header height on a DataGrid control in Flex’
The following example shows how you can set a custom stretch cursor for a Flex DataGrid with resizable columns by setting the stretchCursor style.
Full code after the jump.
Continue reading ‘Setting a custom stretch cursor on a DataGrid in Flex’