When does the Fields Property of LayerDataSource get set?

Discussion created by epaitz-esristaff Employee on Nov 1, 2012
Latest reply on Nov 3, 2012 by jhansi131
We are adding layers on the fly in our application.

DynamicLayerInfo dynamicLayerInfo = new DynamicLayerInfo() {
  ID = <id>,
  Name = <name>,
  DefaultVisibility = <defaultVisibility>,
  MaxScale = <maxScale>,
  MinScale = <minScale>,
  Source = new LayerDataSource() {
    DataSource = new TableDataSource() {
      WorkspaceID = "MyDatabaseWorkspaceID",
      DataSourceName = <dataSourceName>

This code is obviously just pseudo code that is part of a loop where we have access to the <bracketed> variables.

Now the LayerDataSource has a Fields (get/set) property. I was REALLY hoping that it would read the Fields from the data source (an SDE Feature Class in our case) and populate the Fields list, but this does not seem to be the case.

So will this Fields property list ever get populated or is it up to the developer to define them?