I would like to build an XControl based on an MulticolumnListBox. Double clicking should open an additional window for editing several columns of the selected line.
The data to be displayed is hidden in the State Ability of the XControl while the actual Data is an Integer indication the selected line.
Writing data to the control using properties or methods works fine. But editing using a pop up window does not have the right data.
What did I wrong?
Please find attach the XControl as far as I got.
In the posted Zip file is a control missing. I have fixed this and added a test VI (It's in the MyMCListBox Subdirectory).
Many apologies for any inconveniences
thanks for posting to our forums.
Unfortunately, there are still two files missing: the popup window "Werte Auswahlfenster.vi" and "Findings III Control.ctl". Could you please post these files, as well?
Thanks and best regards,
I am really sorry about that.
Please find attached a corrected Zip file.
A related question is: How can I access parts of the XControl Data (e. g. one element of a cluster or an array) using methods or properties?
This would help me as well.
The problem you are is seeing is due to being off by 1 when indexing the Werte array. In the Table: Mouse Down event in the facade of the XControl, you index the Werte array at array size. This means that the array is being indexed at a value that is not initialized, so it creates a new value using the default.
To fix this, insert a decrement function between the Array Size function and the comparison Less or Equal. This will index the correct element in the array to modify.
you are right. The indexing is not correct.
But the property "Active Cell" seems not to work properly. I supposed that it returns the indices of the cell which I click/activate with the mouse.
What is the use of this property?
This property will be used to set the active cell.
To read the position you will need to use a mouse down or click event.
The following forums post is discussing this and you will find a little event-based example at the end of the first page.
The point is that active cell property does not return the row and column of the cell where the user clicked (regardless the event which is evaluated). Active cell property is used to select the cell(s) which should be altered by setting e.g. background color or font. My assumption was wrong and the documentation is not clear enough. One needs some algorithm to calculate the row and column of the clicked cell from the mouse position inside the multicolumn listbox as well as the cell widths and cell heights (now using the active cell property to read witdh and height of all cells).
On the other hand a table control can provide the activated cell usind the property is named Selection Start but it doesn't provide highlighting of the selected row.