First question how to add custom column to aspxgridview column using looping to get name and value of column.
here is my code behind :
Protected Sub gridSubmission_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridSubmission.Init
Dim colBaru As GridViewDataTextColumn = New GridViewDataTextColumn()
For i As Integer = 1 To 6
colBaru.Caption = i
colBaru.FieldName = i
colBaru.UnboundType = DevExpress.Data.UnboundColumnType.Integer
colBaru.VisibleIndex = gridSubmission.VisibleColumns.Count
colBaru.PropertiesTextEdit.DisplayFormatString = "c2"
gridSubmission.Columns.Add(colBaru)
Next
end sub
which i used to add new column at aspxgridview. but its getting an error, "An item with the same key has already been added."
second question, what property which i must use to put that code? I wanted load that code after page.load ! if i put in aspxgridview.init its was loaded before page.load.
and the output it must like this :
1 2 3 4 5 6
row row row row row row
row row row row row row
row row row row row row
row row row row row row
row row row row row row
help pelase...
thanks before