Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » desire: ArrayCtrl and GridCtrl: Find in the row
desire: ArrayCtrl and GridCtrl: Find in the row [message #11932] Tue, 02 October 2007 21:52 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I saw that these ctrl have a Find method that works for a given Column. Unfortunately there is not (I didn't see it) an equivalent that work for a given row.
I wish to have it in future.

Thanks,
Luigi
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11934 is a reply to message #11932] Tue, 02 October 2007 23:01 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Could you be more precise? What you mean by finding row (what criteria?)
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11935 is a reply to message #11934] Tue, 02 October 2007 23:10 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
unodgs wrote on Tue, 02 October 2007 23:01

Could you be more precise? What you mean by finding row (what criteria?)


Hi Daniel,

I mean to find some data, an integer or string for example, in a given row of the ctrl.

Luigi
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11936 is a reply to message #11935] Tue, 02 October 2007 23:13 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

forlano wrote on Tue, 02 October 2007 17:10

unodgs wrote on Tue, 02 October 2007 23:01

Could you be more precise? What you mean by finding row (what criteria?)


Hi Daniel,

I mean to find some data, an integer or string for example, in a given row of the ctrl.

Luigi

I can provide
int Find(in)Row(int row, const Value& val)
It returns column number (or -1 if not found) which contain given value in row 'row'. Is that what you want?
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11937 is a reply to message #11936] Tue, 02 October 2007 23:17 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
unodgs wrote on Tue, 02 October 2007 23:13

forlano wrote on Tue, 02 October 2007 17:10

unodgs wrote on Tue, 02 October 2007 23:01

Could you be more precise? What you mean by finding row (what criteria?)


Hi Daniel,

I mean to find some data, an integer or string for example, in a given row of the ctrl.

Luigi

I can provide
int Find(in)Row(int row, const Value& val)
It returns column number (or -1 if not found) which contain given value in row 'row'. Is that what you want?


Yes, just that.
I did it myself but I'm having problem to find the value when the background is colored. I'm afraid there is some interaction of the value with the background.
Thanks a lot,
Luigi
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11980 is a reply to message #11932] Sat, 06 October 2007 17:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
What is wrong with ArrayCtrl::Find?

Only note that the "index position" is not the same things as "column", but in 90% cases, they are similar.

Mirek
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11989 is a reply to message #11980] Sat, 06 October 2007 20:13 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Sat, 06 October 2007 17:42

What is wrong with ArrayCtrl::Find?

Only note that the "index position" is not the same things as "column", but in 90% cases, they are similar.

Mirek


I've not understood your answer.
My problem is to search a value, int or String, in a given row. How to perform this using ArrayCtrl::Find()?

Luigi
Re: desire: ArrayCtrl and GridCtrl: Find in the row [message #11992 is a reply to message #11989] Sat, 06 October 2007 23:43 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sorry, my mistake. Have not noticed the "row".

Anyway, it should be 4 lines function, something like:

int FindInRow(const ArrayCtrl& a, int ii, const Value& v)
{
   for(int i = 0; i < a.GetIndexCount(); i++)
       if(a.Get(ii, i) == v)
            return i;
   return -1;
}


[Updated on: Sat, 06 October 2007 23:44]

Report message to a moderator

Previous Topic: AttrText() and content of the cell
Next Topic: getting and selecting cells in gridctrl
Goto Forum:
  


Current Time: Sun Apr 28 23:25:32 CEST 2024

Total time taken to generate the page: 0.04046 seconds