| |||||||
DataGridColumnCollection.AddAt MethodSystem.Web.UI.WebControls Namespace DataGridColumnCollection Class Inserts a DataGridColumn to the collection at the specified index. [ VB ] Public Sub AddAt ( _ ByVal index As Integer, _ ByVal column As DataGridColumn _ ) [ C# ] public void AddAt ( int index, DataGridColumn column ); [ C++ ] public: void AddAt ( int index, DataGridColumn* column ); [ JScript ] public function AddAt ( index : int, column : DataGridColumn ); Parameters
RemarksUse this method to insert a DataGridColumn derived object at the specified index location in the DataGridColumnCollection. The DataGrid control does not store the contents of its Columns collection into the view state. To add or remove a column dynamically, you must programmaticallt add or remove the column each time the page is refreshed. Provide a Page_Init function that adds or removes the column before the DataGrid control can reload its state and rebuild itself. Otherwise, the changes to the Columns collection are not reflected in the DataGrid control when it is displayed.
ExampleThe following example demonstrates how use the AddAt method to dynamically add a column to a DataGrid control.
See AlsoDataGridColumnCollection Members Add Remove RemoveAt |
| ||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme