Step 1: Create a CSV file.
Open Microsoft Excel and prepare the following structure with three fields or columns.
Name Phone Country
And enter some values for these fields. While saving the file, in the file type, change it to CSV format. We will name this file as TextExcel.
Step 2: Create a Flex 2 project with the following structure.
Now copy the CSV file that you have created into this project folder.
Create a DataGrid inside a Panel with three columns. We will add a button "Read" which when clicked will read the CSV file and set the values in the DataGrid.
When the spliting and creating of the records array is done, the final step will be setting this array to the Datagrid's dataProvider.
And we are done!!!!.
Now we are all set to run the project. When the browser opens up, you just have to click the button to show up the data in the DataGrid. Here is a screenshot of the ouput.
NOTE : If you are not able to see the code in the pictures, click on the image and it will open up in a new window.