Flex : How to have tooltip on every Row of DataGrid

Tagged Under : ,

If you have a DatGrid and you want to display row specific data on mouseOver, here is how this can be done.

The first step is to enable showDataTips property for every DataGridColumn that you want to enable this functionality on.
Secondly, you need to have a dataTipFunction function on the DatGrid itself. Because dataTipFunction passes over the Grid row data as an Object to the calling function, you dont need to pass any arguments to it. Here is a little example that shows how to do it.

Flex : How to pre-select an Item in DataGrid

Tagged Under : ,

If you want to pre-select an item in a Datagrid when it loads for the first time, this is how you can do it. The idea is really simple, just set the selectedIndex property of the Datagrid to the index you want and then scroll the DataGrid to the selectedIndex. Took me a while to figure it out. However, turns out the you need to call validateNow() before you call the scrollToindex() on DataGrid.

Sample code posted below. More »