usage of string[] property - C#

Posted by: droopy5 on 8 September 2017, 1:23 pm EST

  • Posted 8 September 2017, 1:23 pm EST


    hi


     I have a spread(fpspread3) with just 1 column and 5 rows hosted in a popupcombo control. I have the text as(for example)


    AA        Apple


    BB        Banana


    CC        Carrot........  


    I used the below code to populate certain cells in another spread  with  the text from above


     


    string[] pId = fpSpread3.Sheets[0].Cells[e.Row, e.Column].Text.Split(" ".ToCharArray());


    fpSpread2.Sheets[0].Cells[2, 4].Text = pId[0];...............this results in 'AA' or 'BB' based on what i select from the spread.


     


    In few other cells,i want the text as  "AA     Apple" (or) "BB    Banana" instead of just the abrreviation.


    How do i change the code so that i get both the abbreviation and the full word?Am using C#


     


     

  • Replied 8 September 2017, 1:23 pm EST

    Droopy -

    How is the text in the cells in in fpSpread3 being put in the cells?

  • Replied 8 September 2017, 1:23 pm EST

     


     The text in fpspread3 cells have only 1 column....and there is a lot of space between the two words...eg:   AA                 Apple


    So the above code that i have posted already takes only the first word('AA') 


    This is fine for few cells


    But for other cells i want it as a whole text..eg: AA   Apple


    fpSpread2.Sheets[0].Cells[2, 4].Text = pId[0];...............This is how i assign the 'AA' alone to my fpspread2 sheet cells.

  • Replied 8 September 2017, 1:23 pm EST

    Can you post a small project for this.  I am not understanding what you are doing.
  • Replied 8 September 2017, 1:23 pm EST

    Hello,


    Each element of the pId array should have part of the overall string, so you should be able to loop the elements of the array to reconstruct the entire string that you want to assign for the text in the cell.

Need extra support?

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

Learn More

Forum Channels