07-08-2019 11:48 AM
Hello,
I have a table on my front panel that I populate with information. It has a horizontal scrollbar so you can scroll to see all the different columns of information. My problem is that for some reason I have 6 extra empty columns that I can't seems to get rid of. I have tried changing the number of columns through a property node (NumCols) but that only changed how many are displayed, I can still scroll over to the extra empty columns. Anyone know how to set a certain number of columns on a table in LabVIEW? Thanks.
07-08-2019 12:16 PM
Not only that but clicking the right arrow next to the scrollbar would allow you to scroll infinitely to the right, not just the six extra columns that you mention.
Try to click and drag from first column to another column off-screen. How do you prevent that method of scrolling?
I think in order to prevent some of this behavior, you'll have to do something fancy with mouse down/move events and the invoke node "Point to Row Column". However I seriously doubt that you'll be able to prevent scrolling in all possible scenarios without creating some other unwanted, funky behavior. You should probably re-evaluate your priorities to determine if this is really that important to you. Maybe you could look at a multi-column listbox because it doesn't seem to have this "feature".
07-08-2019 04:06 PM
@ebohannon wrote:
Anyone know how to set a certain number of columns on a table in LabVIEW? Thanks.
To try to answer your specific question, this is not possible AFAIK. As you have discovered, you can only control the number of visible rows and columns. The table control in LabVIEW is akin to an Excel spreadsheet, an endless canvas of cells/rows/columns, which is different than Word's implementation of tables where rows and columns can be deleted at will.
07-09-2019 07:19 AM
@aputman wrote:
Try to click and drag from first column to another column off-screen. How do you prevent that method of scrolling?
Just tested this, but I can't reproduce this behavior. Are you confusing the MCLB and a table? The table does have this behavior...
The scrollbar seems to be the only way to scroll horizontally. Simply hiding the horizontal scrollbar prevents the user from doing this.
You can change the width of the columns manually, or from your program. If you have 6 columns, and you know the width of the MCLB, you can calculate and set the width of the columns. Then you'd have 6 columns as far as the user is concerned. I do this all the time.
07-09-2019 08:16 AM
wiebe@CARYA wrote:
@aputman wrote:
Try to click and drag from first column to another column off-screen. How do you prevent that method of scrolling?
Just tested this, but I can't reproduce this behavior. Are you confusing the MCLB and a table? The table does have this behavior...
No I'm not confusing the MCLB and a table. The OP said they were using a table and I pointed out additional methods of scrolling on a table that would be difficult to prevent. I did suggest switching to a MCLB at the end of my post because some of these "features" are not found in that type of a control. Am I missing something?
07-09-2019 09:41 AM - edited 07-09-2019 09:43 AM
@aputman wrote:
wiebe@CARYA wrote:
@aputman wrote:
Try to click and drag from first column to another column off-screen. How do you prevent that method of scrolling?
Just tested this, but I can't reproduce this behavior. Are you confusing the MCLB and a table? The table does have this behavior...
No I'm not confusing the MCLB and a table. The OP said they were using a table and I pointed out additional methods of scrolling on a table that would be difficult to prevent. I did suggest switching to a MCLB at the end of my post because some of these "features" are not found in that type of a control. Am I missing something?
No, it's probably me...
06-03-2021 10:46 AM
You can create a property node, index values, change all to write, than set it to 0,0
06-03-2021 01:02 PM
To prevent unwanted scrolling on a Table control, I got rid of the scroll bars and made my own. Not fun, but it can be done. You then have control over the scroll bar and can set limits, etc. Works well and almost looks like a native scroll bar if you use splitters correctly. The MCLB control does not suffer from this problem, but I avoided using it because it needs to be updated via property nodes for new values, which is slower in the long run. If you are not updating often then a MCLB might be okay.
Below is a screen shot a Table control and a separate scroll bar control. There is about 1 pixel misalignment at the bottom that I cannot seem to fix. Sigh.
mcduff