02-24-2010 02:28 AM
I need a table with a head consisting of several rows and columns.
Is that possible with CVI, and if so how?
Solved! Go to Solution.
02-24-2010 03:51 AM - edited 02-24-2010 03:52 AM
Table column or row headers can be multiline as (almost) any other text element in CVI panels: you can obtain itby pressing Ctrl+Enter while editing the text in the UIR editor. You will need to increase header row dimension to fitthe newlabel.
On the other hand, unfortunately it is not possible to have more than one header line in native CVI tables. Moreover, it is not possible to merge cells on some row as you can do in Excel, so when I need a more complicated arrangement for headers I normally use a separate table for it. The "header table" is set as an indicator and I set cell widths according to my needs.
You may see both tricks in this example:
02-24-2010 03:57 AM
I need no normal multiline.
Ok so I musst use a separate table.
Thank you.
03-01-2010 08:56 AM
03-01-2010 10:46 AM
As far as I can understand, only horizontal scrolling should affect your situation, as the table header should not need to change in case of a vertical scroll.
In any case you should be able to trap EVENT_HSCROLL (and even EVENT_VSCROLL) in the table callback, get the first visible column (row) and scroll consequently the additional header table. You could also try to see if it that column is suitable for the separate header table (in my example, scrolling horizontally by one column only will not permit syncronous scrolling of the two tables): in case it's not, you could try adjusting both tables by using SetCtrlAttribute (panelHandle, PANEL_TABLE, ATTR_FIRST_VISIBLE_COLUMN, x) with an appropriate number of columns in 'x'
03-03-2010 06:32 AM
Ah, thank you. The tables now scroll with horzontal EVENT_HSCROLL.
The table below has the scroll bar. It scrolls only in small steps, and whenever a new column has reached the top jump to the next column. It does not look good.
The table below should scroll only whole columns. How can I do that?