Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SelectedRows in C1 TrueDBGrid

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
This is a hopeful punt, that someone out there also uses C1 Grids, and can offer me a little help

I understand how the SelectedRows collection works, and I have my grid working with Windows shift,ctrl click type functionality, and I can get back the selected rows as a datarow collection quite easily.

However, what I am after is in effect to reverse this operation. Imagine the underlying datatable below, which is the datasource to the grid

Col1,Col2,Col3
"A","ME",100
"A","YOU",200
"B","ME",300

What I want to do is to auto-select the grid rows, for where a datacolumn equals a value of my choice, eg COL2='ME'

What I cant figure out is how to get the grids row index from the relevant Datarows of the datatable.

Any ideas anyone??






Sweep
...if it works dont mess with it
 
Not sure if there is a faster way to do it, but you could use a loop to find the index of the records you want highlighted, and then use those numbers to get the row from the collection.

-Rick

----------------------
 
Andrea - tried posting to C1 Newsgroup, but with no response.
Rick - you must have read my mind!

In the end I used a "go top" and "while not eof()" method, and interrogated each row, which in turn ensured I was on the correct grid row. Previously I was trying to utilise a DataView and DataRowView to achieve the desired effect.




Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top