Setting the selected item is not the same as a click. If you created the renderer correctly the style should change when you actually click on the item. (Does it?)
Or are you just trying to get the first row's background to be a different style when the datagrid first shows? (Initialization problem or not working at all?)
When I clicking it , it is getting set properly.
I want to have the first record as selected by default. So I set the selectedItem to 0. As you said it is the initialization problem.
Is there anyother event or function with which can I achieve it?
In theory, you would override updateDisplayList, call
DataGrid(owner).isItemSelected(data) and set the background based on that,
then it should work whether you click or set selectedItem/selectedIndex.
Should I override in the customitemrenderer??
Hi.. Thansk a lot FlexHarUI.
Your tip worked for me.. Thank you very much...