I have the very simple code below which should allow me to select a customer from a drop down list and disply the associated spreadsheet in a CellsWebGrid.
However, data from the previous customer is displayed amongst the data from the most recently selected customer. i.e. data is not cleared before databinding.
Protected Sub acbxCustomer1_DataChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles acbxCustomer1.DataChanged
Try
GridWeb1.WebWorksheets.ImportExcelFile("c:\Data\Utilisation for " & acbxCustomer1.A_Text & “.xlsx”)
GridWeb1.DataBind()
Catch ex As Exception
Message(“Exception in acbxCustomer1_DataChanged”)
Message(ex.Message)
End Try
What is happening here? Is there something more that databind which is required to do a standard databind?
Regards
Richard
End Sub
Hi,
I have read the articles and demos that you pointed me to.
You documentation also points to a much easier way of addressing the problem of databinding (importing) a spreadsheet at runtime. You can find this at:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/opening-an-ms-excel-file.html
According to my reading of the information provided there all I have to do is
GridWeb1.WebWorksheets.ImportExcelFile(“filename”)
It appears to work just like the documentation suggest with the execption of loading the data for a second customer. When this problem appeared I added the “dataBind” as that would be a pretty normal .net approach.
So, using the documented “importExcelFile” how do I clear the data from the previous load?
Many thanks
Richard
Hi,