LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmatically scroll a table

Solved!
Go to solution

How to translate this LabVIEW VI to CVI ?

 

Table.png

 

George Zou
Message 1 of 4
(5,056 Views)
Solution
Accepted by topic author zou

The nearest equivalent should be SetActiveTableCell ().



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(5,044 Views)

That VI actually make the specified cell row up to be the top-left visible cell.

 

Got help from NI AE.

         SetCtrlAttribute(panel, PANEL_TABLE, ATTR_FIRST_VISIBLE_ROW, cell.y);

works in the following code:

  cell.x = 2;
  cell.y = 1; 
  err = GetTableCellFromValue (panel, PANEL_TABLE, cell, MakeRect(1,2,NR-1,1), &cell, VAL_COLUMN_MAJOR, VAL_CELL_STRING, VAL_CHAR,selected);
  if ( ( err < 0) || ( (cell.x == 0) && (cell.y == 0)  ) )
  {
   //not found
   cell.x = 2;
   cell.y = 1;
  }
  
  MessagePopup("","");
  err = SetCtrlAttribute(panel, PANEL_TABLE, ATTR_FIRST_VISIBLE_ROW, cell.y);
  if (err < 0)
   MessagePopup("Error", "Setting first visible row in table.");
 
  SetTableCellRangeAttribute(panel, PANEL_TABLE, MakeRect(cell.y, 2, 1, NC-1), ATTR_TEXT_BGCOLOR, VAL_CYAN);

 

 

However, if I comment out MessagePopup("","");

then it won't work.

 

 

George Zou
0 Kudos
Message 3 of 4
(5,041 Views)

SetActiveTableCell ()

Not exactly what I expected.  But works too.

Doesn't have to be top row.  As long as visible, works for me.

Thanks.

 

George Zou
0 Kudos
Message 4 of 4
(5,036 Views)