i have dev express ASPxGridView. the column and data for the gridview will be dynamically based on the dropdown value.
If type = "procedure" Then
SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
Else
SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.Text
End If
SqlDataSource2.SelectCommand = rptquery
Try
SqlDataSource2.DataBind()
dataview1 = SqlDataSource2.Select(System.Web.UI.DataSourceSelectArguments.Empty)
gv.DataSourceID = "SqlDataSource2"
For Each dc In dataview1.Table.Columns
Dim DynamicColumn = New DevExpress.Web.ASPxGridView.GridViewDataTextColumn()
DynamicColumn.FieldName = dc.ColumnName
DynamicColumn.Caption = dc.ColumnName
gv.Columns.Insert(i, DynamicColumn)
i = i + 1
Next
gv.DataBind()
Catch ex As Exception
End Try
Then i have export button to excel. my problem is it will only export the column name of the gridview into the excel sheey. data is empty. but in gridview data is shown. please help me on this issue.