Hi,
I didn't see the spreadsheet control (it was not attached). But from your
code it seems that you are not actually adding TextBox controls. If you're
trying to read the content of a cell within your MayerSoft control, you need
to follow the control's documented method for doing this. Control authors
can do all sorts of things to handle values. This control apparently uses a
"Cells" collection--but it is unclear whether each Cell object is a
container for other controls or if it is simply a non-container object with
properties. I would think you can use ...Cells["r1c1"].Value, or something
similar to obtain the value of the control.
I know you saw input boxes in the HTML output, but this has nothing to do
with how those boxes are represented SERVER-SIDE. Your spreadsheet object
has total ownership of how HTML is abstracted, so the only way to use the
object to parse client-side input is to refer to the control's own
documentation...
Does this help?
kw said:
Hi Scott, I tried it both from the Page_Load and from the
btnSpreadsheetUpdate_Click event, neither worked. Here is the test
page.
I
attached the actual WebControl (Spreadsheet.cs). Thanks so much for looking
at this...I'm really stumped as to how to get my values back.
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button btnSpreadsheetUpdate;
protected MayerSoft.Web.Controls.Spreadsheet Spreadsheet1;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
this.Spreadsheet1.MaxRows=5;
ColumnCollection cols=new ColumnCollection();
//this.Spreadsheet1.Columns.Clear();
//this.Spreadsheet1.Columns.Add(new MayerSoft.Web.Controls.Column(150));
//this.Spreadsheet1.Columns.Add(new MayerSoft.Web.Controls.Column(75));
cols.Add(new Column(150));
cols.Add(new Column(75));
this.Spreadsheet1.Columns=cols;
CellCollection cells=new CellCollection();
cells.Add(new MayerSoft.Web.Controls.Cell(0,0,"Item
A",string.Empty,"Label",string.Empty,true));
cells.Add(new
MayerSoft.Web.Controls.Cell(1,0,"100",string.Empty,"Number",string.Empty,fal
se));
this.Spreadsheet1.Cells=cells;
}
else
{
System.Web.UI.Control c2 = this.Spreadsheet1.FindControl("c1r0");//returns
null
System.Web.UI.Control c1 = this.Page.FindControl("c1r0" );//returns null
System.Web.UI.Control c0 = this.FindControl("c1r0" );//returns null
System.Diagnostics.Debug.WriteLine(this.Spreadsheet1.Cells["c1r0"].Value);//
System.Diagnostics.Debug.WriteLine(this.Spreadsheet1.Cells["c1r0"].Value);//