# Automatically select first listItems? \[Flex\]

**URL:** <https://forum.kirupa.com/t/automatically-select-first-listitems-flex/238302>\
**Category:** flash\
**Created:** [September 9, 2007, 4:41pm UTC](https://forum.kirupa.com/t/automatically-select-first-listitems-flex/238302 "2007-09-09T16:41:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ff45t1z](https://avatars.discourse-cdn.com/v4/letter/f/f1d935/32.png) [@ff45t1z](https://forum.kirupa.com/u/ff45t1z)\
**Post date:** [September 9, 2007, 4:41pm UTC](https://forum.kirupa.com/t/automatically-select-first-listitems-flex/238302/1 "2007-09-09T16:41:41Z")

</div>

Hey all, hopefully this isn’t too obvious a question, but I’ve been wondering…  
In Flex I’ve built a DataGrid, inside which is contained a few options. You select an item, and several fields in the application display associated information. ( The application in question is a discography for a band. ),  
However, there are buttons in the application that i’ve designed to link off to HTML pages containing lyrics/artwork. This works successfully, however… the buttons run on {datagrid.SelectedItem…} etc. Thus, if the user clicks the button before an item is selected Flash generates an IOerror. ( not that the user in all cases can see this. ) ( the grid loads the URL for the associated lyrics/art from XML. )  
Is there a way to set Flex to automatically select the first list item?
