Example name: Binding data grid to array result
Description: Shows how to bind a Flex DataGrid component's dataprovider field to the Array returned by a .NET remote service.
Prerequisites:
Client-side code: Browse  Download
Server-side code: Browse  Download
Feature availability:
  • WebORB for .NET Development Mode
  • WebORB for .NET Community Edition
  • WebORB for .NET Enterprise Edition
Run example:
Key points:
  • It is simple display a .NET remote service's Array-based result in a Flex DataGrid.
    • Bind an ArrayCollection's 'source' field to the correct result in the service's model, and
    • Bind the DataGrid's 'dataprovider' field to this ArrayCollection.
  • For reasons noted here, bind dataprovider fields only to collections (such as ArrayCollection or ArrayList), not to 'raw' Arrays.
    • That's why this sample's client's DataGrid's dataprovider binds to an ArrayCollection (line 61), which binds to an Array (line 58).
   
Things to try:
  • Make mistakes on purpose, such as binding the DataGrid's 'dataprovider' field directly to the .NET service's Array-based result. What happens? Why isn't this 'best practice'?
See also:
Errata:
  • None yet known.