2 Replies Latest reply on Feb 20, 2009 6:04 AM by Gregory Lafrance

    DataGrid to display No Data when dataProvider is null

    avfxxczgfsd
      Hi,

      Im new to flex. im trying to display "No Data" when the dataProvider for the DataGrid is null.

      how can i do this. can i display the text "No Data" in the grid or can i display text "No Data" with out grid

      Thanks in advance
        • 1. Re: DataGrid to display No Data when dataProvider is null
          markuspedro
          yes you can...
          to make this you must associate an xml or array with the same number of column of the datagrid and inside it you write no data.
          if the value of xml==null then call as dataprovider your array

          bye
          • 2. Re: DataGrid to display No Data when dataProvider is null
            Gregory Lafrance Level 6
            Are you saying that if the data provider is null then while you want to be able to create a DataGrid with a single row of data, where the cells in that one row for all columns contain "No Data"?

            In that case perhaps you can use the creationComplete event, and if the dataProvider is null dynamically create an Object with number of fields for the columns, all with the data "No Data". Of course, if your data is coming in from HTTPService etc., you might display this for a split second before true data gets populated.

            If you want to ensure that "No Data" is displayed for an individual cell if no data is available, the maybe a labelFunction would do the trick.