C
Cowboy \(Gregory A. Beamer\)
In this instance, since you know what the user wants when you query the
data, I would consider sorting the data on the server when you pull the
data. I am not sure why it bombs (I would have to examine the HTML
produced), but it is easily solved by sorting on the Data tier and avoiding
the issue on the Presentation tier.
Dear All,
I want to export datagrid content to a Excel file, the code just like
below:
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
gridList.Columns(0).Visible = False
gridList.Columns(1).SortExpression = ""
gridList.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
....
If my datagrid Allowsorting=true, then the code run error,but if I
config the Allowsorting=false, then above code run fine.
Please help me how to export if my datagrid has the allowsorting
properity.
Any help welcomes.
Best Regards,
Eric.
data, I would consider sorting the data on the server when you pull the
data. I am not sure why it bombs (I would have to examine the HTML
produced), but it is easily solved by sorting on the Data tier and avoiding
the issue on the Presentation tier.
Dear All,
I want to export datagrid content to a Excel file, the code just like
below:
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
gridList.Columns(0).Visible = False
gridList.Columns(1).SortExpression = ""
gridList.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
....
If my datagrid Allowsorting=true, then the code run error,but if I
config the Allowsorting=false, then above code run fine.
Please help me how to export if my datagrid has the allowsorting
properity.
Any help welcomes.
Best Regards,
Eric.