Adding a dropdownlist programmatically to a ASP.NET webpage

N

NaderH

Hello and thanks in advance,

I have an issue that I am trying to work around. I have an aspx page that
needs to load up a formated XLS spreadsheet into a DIV tag and then allow the
user to input data that will be retrieved later on postback and values store
in a MS SQL database.

I created an excel spreadsheet and formatted it with the formulas and
colors. I also added a combobox from the control toolbox. I also added a
checkbox from the control toolbox to another cell. I then saved the page
using File-->Save AS WebPage. I checked the 'Add Interactively' checkbox on
the save dialog. I then opened the file in an editor and copied the object
tag into my aspx page. Everything was fine except my combobox and checkbox
did not appear in the HTML spreadsheet.

I am assuming that I have to EITHER programmatically add the controls prior
to render or add the combobox as a XML element to the proper node of the
XMLData value parameter attribute.

the current XML Block for this node is :

<Row ss:AutoFitHeight="0" ss:Height="18.75">
<Cell ss:StyleID="s23"><Data ss:Type="String">Fund</Data></Cell>
<Cell ss:StyleID="s23"/>
<Cell ss:StyleID="s23"><Data ss:Type="String">Eng</Data></Cell>
<Cell ss:StyleID="s24" ss:Formula="=SUM(RC[1]:RC[11])"><Data
ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
<Cell ss:StyleID="s25"/>
</Row>

The second cell, between FUND and ENG is where I need to add the combobox.

Does anyone have a clean way of doing this? also how about binding data to
this control. This data is coming from SQL DB, and not from a range in the
activesheet.

Thanks in advance
NaderH
 
J

joel

In Excel controls sit on top of the worksheet and not in the cells. th
controls are treated as shapes. I think using Access instead of Exce
is the corect solution. In Acces the controls are really part of th
database structure and the controls go into the database rather than
shape sitting onto of the database.

Try making a simple database putting the controls into the databas
then save the database as HTML and see if you get the desire results.

You can can open an Access Database is a similar fashion in .Net as yo
would amn Excel Database
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top