问题
I'd like to tinker with the auto-generated columns in a gridview a bit. What event would I want to override to modify them just after they are generated but before the control is rendered?
回答1:
Check out this link for more information on Customizing the Auto-Generated Columns of a GridView Control:
http://msdn.microsoft.com/en-us/library/cc903950(VS.95).aspx
The particular event you are looking for would be the AutoGeneratingColumn event
More information on the AutoGeneratingColumn event
回答2:
The columns are added to the GridView when the DataBind() method is called
回答3:
Those two links are for the Datagrid not Gridview.
来源:https://stackoverflow.com/questions/956498/when-are-the-auto-generated-columns-in-a-gridview-added