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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Highlights, multiple rows 1

Status
Not open for further replies.

flintstone42

Programmer
Aug 7, 2001
52
US
Hi:
Does anyone know how to the user can highlight multiple rows in a grid? The idea is to highlight them and then
copy to clipboard(_VFP.datatoclip()) so they can paste
them in word,,excel or what ever

I know how to hightlight the current row(microsfot.com)

 
If the grid base on a table, create a column, say "IsHightlight" and its datatype is boolean

Set DynamicBackColor to higtlight when "IsHightlight" is true.
Jimmy Le
nhan_tiags@yahoo.com
 
In essence, your record should have a certain condition that evaluates to true when highloighting is to take place.

In the current row situation, the condition is RECNO() == current record.

You can use the same condition to send data to the clipboard.

HTH,
Weedz (Wietze Veld)
My private project:And especially for VFP rookies:
 
flintstone42

Check out FAQ184-433.

You can highlight mulitple rows and copy multiple records from the recordsource with COPY TO xxxx FOR selected.

Chris :)
 
What I need the for the USER, the person running the program
to highlight multiple rows, the copy to command will not do that, the ishighlight would have to be a field in the gridsource?(DBF), I am trying to avoid doing that because
then it would hight for all users(aboout 30 people are using thsi grid at once)
 
You could use a view and make the field that marks the highliting, not updateable.

So in the view, initially the field would be f.i. .F., if the user clicks on the row, it will become .T. but since this particular field is not updateable, only the user seeing the current view, would see the selected row.

HTH,
Weedz (Wietze Veld)
My private project:And especially for VFP rookies:
 
Would that give an idivual view for each user?
Using a view may make the grid the very slow because
the table is continusouly updated and the user need to see
all the changes?
 
> Would that give an idivual view for each user?

I do not really understand what you mean with this, but a view in VFP is actually an updatable cursor, and every user would open the same view, only in another session of your app on different machines.

If you want changes to be visible constantly, you would have to requery the view continuously, but you would also loose your highlight field when you do a requery as stated in my previous message.

What you could do, is to make the user responsible for updates (like in f.i. your web browser, where you would have to refresh to see the latest data).
You could build in a refresh button to let the users see the latest data.

In this refresh action you would simply do a requery on the view and your user would see the latest data, but loose their highlighting.

HTH,
Weedz (Wietze Veld)
My private project:And especially for VFP rookies:
 
flintstone42

What I need the for the USER, the person running the program to highlight multiple rows, the copy to command will not do that.

Assuming you have read it, you seem to have misunderstood FAQ184-433.

Using the multi-select functionality of the grid means that the recordsource has a logical field, TABLE.selected.

Having selected the records, you can then process the selected records, COPY TO xxxx FOR selected etc simply being an example.

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top