Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  


.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[0] as BoundField).DataField = "NewField"

Created By: amos 8/9/2013 10:54:33 AM
Updated: 8/9/2013 10:54:45 AM