Finding Item in Grid

Posted by: rodneybuxton on 8 September 2017, 3:06 pm EST

  • Posted 8 September 2017, 3:06 pm EST

    I'm converting a Windows ListView to a fpsGrid. Using the ListView control there is a

    Index = lstElements.FindItemWithText(sDerElemName, False, 0, True).Index 

    command that allows you to find the index of an entry in the list, is there something would would be equivalent using the grid? Basically I'm trying to find out if there is a value in the list that begins with the value I'm testing with.

    Thanks for any help you can provide.

    Rodney 

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    You can use the Search method, to find the row and column indexes of a cell containing a particular text or value. Please refer to the following link that describes the same:

    http://helpcentral.componentone.com/NetHelp/SpreadNet6/WF/spwin-datasearchplain.html

    The last two parameters passed to this method returns the row and column index of the specific cell. Hope it helps.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:06 pm EST

    Will this work if I just want to find out if the value begins with something?
  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    Yes, you can accomplish the same using the WildCharacters option available in this method, please have a look at the following link that describes the same:

    http://helpcentral.componentone.com/NetHelp/SpreadNet6/WF/FarPoint.Win.Spread~FarPoint.Win.Spread.FpSpread~Search%28Int32,String,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Int32,Int32,Int32,Int32%29.html

    I have attached a sample performing the search, to search for words starting with "A". Click on the button at the bottom, it displays the cell indexes of the cell having words starting with "A".  Clicking on the button multiple times, each time displays the next occurence of a word starting with "A".

    Hope it helps.

    Thanks,

    Manpreet Kaur


    2013/03/SearchWild.zip
  • Replied 8 September 2017, 3:06 pm EST

    Thank you
Need extra support?

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

Learn More

Forum Channels