.NET set DataField or other properties of a grid column at runtime
In the code behind, your columns of gridviews will appear as DataControlFields, without properties that are available in the designer, such as DataField and DataFormatString.
To set these in the code behind, cast the DataControlField to the appropriate type found in the designer. For example:
(myGrid.Columns as BoundField).DataField = "NewField"
Created By: amos 8/9/2013 10:54:33 AM
Updated: 8/9/2013 10:54:45 AM