LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

changing table column order during runtime?

I'd like to know if anyone has been able to allow the user to resort a table's column order during run time?  Sort of like you can with MS Excel.  This could be very handy.

 

I think this could be done with a combination of copy/pasting all the cells of a table, but it would be very labor intensive.

0 Kudos
Message 1 of 5
(4,641 Views)

There is an example program that demonstrates how to sort the table. 

 

samples\userint\colview.cws

 

You can use the example finder to find relevant example programs. (Help>Find Examples..., switch to the Search tab, and enter "sort" in the keywords text control)

Message 2 of 5
(4,618 Views)

Yes, I know about the sample project search (great learning tool!), but that one isn't quite what I want. 

 

I would like to give my user the ability to relocate a column.  Say, from index position 7 to position 1.  I don't want to sort the rows within columns at all.

0 Kudos
Message 3 of 5
(4,614 Views)

You can use GetTableCellRangeVals and SetTableCellRangeVals to swap the contents of the source column and destination column.

Message 4 of 5
(4,590 Views)

Yeah, that's what I was thinking (essentially a copy/paste).  But this would be very tricky, since my various columns aren't of the same data types.

 

Oh well.  Thanks for the help!

0 Kudos
Message 5 of 5
(4,588 Views)