How can I get the TextBox control value into the spread.Cell[row, column].Value

Posted by: lynx550 on 8 September 2017, 3:13 pm EST

  • Posted 8 September 2017, 3:13 pm EST

    In C1.XLBook I have the following code snippet that prints the header of one of my rows in excel.



    sheet(0, 123).Value = "CUSTOM1"
    sheet(0, 123).Style = stylebold


    What I want to do is insert the value of the textbox1.text control into the header .....however the value is not showing up in the excel sheet. I have tried the following with no luck.

    sheet(0, 123).Value = textbox1.text
    sheet(0, 123).Style = stylebold
  • Marked as Answer

    Replied 8 September 2017, 3:13 pm EST

    Hi,

    What I understood from your requirement is that you want to insert the value of a Textbox into a Spread cell. To do the same, I would suggest you to use following line of code:
    fpSpread1_Sheet1.Cells[0, 2].Value = textBox1.Text;


    However, if you wish to display the value of the Textbox into a row header of the spread sheet, please use the following code:
    fpSpread1_Sheet1.RowHeader.Rows[0].Label = textBox1.Text;


    Please refer to the attached sample application for complete implementation. Hope it helps.‚Äč In case my understanding is different than yours, please elaborate on your requirement a bit further so that I can assist you accordingly.

    Thanks and Regards,
    Pragati Kaushik
    2014/05/SpreadCellValueChange.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels