I cannot get any kind of information out of spreadsheet. sheet count is zero, I could not figured out how to access cells...
I load demo xlsx files but I cannot access any information. also there's not much in help section.
Does this control serves just lo load and show xls files ? what I'm missing ?
12 Answers, 1 is accepted
You have to call the DataBind() method in order to access the Sheets and Cells in the code behind.
okay my friend but problem is I cannot even run simple commands like:
Dim workbook As New Workbook()
Dim worksheet As Worksheet = workbook.Worksheets.Add()
worksheet.Name = "Expense Report 2014"
I tried page_load event, page_init event. I read blogpost "SpreadProcessing - Complete Solution.....". obviously I'm doing something wrong. can you please provide a simple sample to add a new worksheet and set a cell's value please ? so I can understand which namespaces should I use because I believe I have problem with importing correct ones. and all the demos are for winforms, I need aspnet solution. I really tried hard but I'm stuck.
The Spreadsheet Control doesn't implement the same interface as the SpreadProcessing library, so there are some differences to be expected. Here's some sample code that populates the Spreadsheet with data from the Products table of the Northwind database, which should point you in the right track:
okay, not I can add sheets, thats fine but then I cannot access them. sheetcount is zero so I cannot access its content although my sheets are visible on the page. I will try to get cell values that user will enter. that's my goal :)
some more help please...
hmmm, looks like on every postback RadSpreadsheet looses its sheets I added before. I tried Page_load or page_init events but nothing changes.
Is there a possibility that this component designed just to show data ?
Because I want to create a blank sheet on page and user will fill it in then when he clicks a button I'll read the values he entered.
I wont work database or anything.
The Spreadsheet control doesn't use ViewState in order to make it more lightweight, and therefore cannot automatically preserve its state across postbacks. If you want to be able to read and write to a custom datasource, you will have to implement a custom provider, which the control will be bound to. Using the provider you can use the "Save" button of the Spreadsheet toolbar to save the state at any time.
I've attached a sample page where a custom provider is implemented. It should be able to point you in the right direction while implementing your requirements.
aha... that's exactly what I need. thank you. I could never think custom data provider.
you are the best.
How can i bind the toolbar Save to a handler method?
The control is still in beta version and it does not provide functionality for handling such events.
Nevertheless, you could try to get reference to the "Save" button in the toolbar and attach handler for the "onmousedown" event.
I have a webpage using RadSpreadsheet control. Now i have to write the event to set the range values to validate only numbers. and i need to get the cell edit event to change the cell forecolore based on the values. like 0-3 red others green and maximum 10 else error messge.
Can anybody give the details for me.
The issue that was the topic of this forum thread has been answered and resolved. Since your question is not related to the current topic, I would advise you to open a separate forum thread, where the specific case can be investigated.
Telerik by Progress
Hello Bozidar's ,
Can you please help me with sample code to save file on Shared location .Its an export functionality that I am working on.