LMartin Posted February 14, 2011 Report Share Posted February 14, 2011 (edited) Hi Guys, I would like to use a Multicolumn Listbox, but it's trying hard. What I want to do is to double-clic on a cell, get his position, and allow the user to edit it or not, according to the position. I've notice that it can two kind of type: String or I32, - Is there a way to switch between theese two type? plus when it's define as a string, I don't have the "Allow edit cell" property, like when it's a I32 type. - Is there a way to do that when the type is a String ? - Or is a way to get the Selection Start property when is an I32 ? Thanks for any feedback! Martin Edited February 14, 2011 by LMartin Quote Link to comment
gleichman Posted February 14, 2011 Report Share Posted February 14, 2011 An MCL is an I32 and a table is a 2D string. Text is added to an MCL programmatically through the property "ItemNames". The MCL event "EditCell?" will allow you to read the selected cell and discard if not correct. Hi Guys, I would like to use a Multicolumn Listbox, but it's trying hard. What I want to do is to double-clic on a cell, get his position, and allow the user to edit it or not, according to the position. I've notice that it can two kind of type: String or I32, - Is there a way to switch between theese two type? plus when it's define as a string, I don't have the "Allow edit cell" property, like when it's a I32 type. - Is there a way to do that when the type is a String ? - Or is a way to get the Selection Start property when is an I32 ? Thanks for any feedback! Martin Quote Link to comment
LMartin Posted February 14, 2011 Author Report Share Posted February 14, 2011 Hi, Thanks, for the reply I didn't know about this event, But it's like the Multicolumn Listbox can not be editable at run time, as you will see in the attach vi, i've wired the "Allow editting cell" property to a constant true, but it's not working. May be i did it wrong or it's just impossible, Trying to find out, but it still trying hard, even on a valentine day. Thanks again for your help, I'll be pleased to get this matter resolved. An MCL is an I32 and a table is a 2D string. Text is added to an MCL programmatically through the property "ItemNames". The MCL event "EditCell?" will allow you to read the selected cell and discard if not correct. Multicolumn_listbox.vi Quote Link to comment
ned Posted February 14, 2011 Report Share Posted February 14, 2011 I don't have LabVIEW 2010 installed so I can't open your VI, but I've found that you can only edit cells that already have text in them; you can't add text to new cells. You also have to click in exactly the right place at the right time in order to edit cell contents. I prefer to use a table control if the user needs to be able to edit values. If you want to be fancy about it, create a table indicator instead and add a few individual controls for different data types. When the user clicks on a cell in the table, get the cell location (the table control has a method for this). If the user is allowed to edit that cell, make the control appropriate to the datatype of that column visible and move it to the the cell that was clicked. When the user finishes editing the value, copy the control's value into the appropriate cell in the table and hide the individual control. It takes some work but you can build a very nice-looking interface that lets you mix and match datatypes in the same table, and also have some columns that can be edited and others that cannot. With more work you can have the tab key operate properly, moving from one column to the next. Here's an example of this from one of my applications; the first column is values from a Ring control that is populated at run-time, the second column is a floating-point value, and the third column is an enumeration. The remaining columns are calculated and populated as the user fills them. Quote Link to comment
Jon Kokott Posted February 14, 2011 Report Share Posted February 14, 2011 Create event structure, event MCL, "Double Click" Using MCL ref: Invoke node convert point to row column, to get cell position Property node write edit position, put in the cell poistion. viola ~Jon Quote Link to comment
LMartin Posted February 14, 2011 Author Report Share Posted February 14, 2011 Thanks guys, It's working quite nice, as i wished. Quote Link to comment
ShaunR Posted February 15, 2011 Report Share Posted February 15, 2011 I don't have LabVIEW 2010 installed so I can't open your VI, but I've found that you can only edit cells that already have text in them; you can't add text to new cells. You also have to click in exactly the right place at the right time in order to edit cell contents. I prefer to use a table control if the user needs to be able to edit values. If you want to be fancy about it, create a table indicator instead and add a few individual controls for different data types. When the user clicks on a cell in the table, get the cell location (the table control has a method for this). If the user is allowed to edit that cell, make the control appropriate to the datatype of that column visible and move it to the the cell that was clicked. When the user finishes editing the value, copy the control's value into the appropriate cell in the table and hide the individual control. It takes some work but you can build a very nice-looking interface that lets you mix and match datatypes in the same table, and also have some columns that can be edited and others that cannot. With more work you can have the tab key operate properly, moving from one column to the next. Here's an example of this from one of my applications; the first column is values from a Ring control that is populated at run-time, the second column is a floating-point value, and the third column is an enumeration. The remaining columns are calculated and populated as the user fills them. Thats what the MCL should be as a control (your picture) without us having to jump through hoops and use hacks to emulate proper controls.. It's about time NI stopped faffing with blue sky stuff and put more effort into the core stuff that's been needing development for the last 5 years that everybody uses (controls, events, installer, more integrated source control support (svn, mercurial) .... et al.) 1 Quote Link to comment
Stobber Posted February 21, 2013 Report Share Posted February 21, 2013 With more work you can have the tab key operate properly, moving from one column to the next. Any specific advice on how? I've been looking into this and don't see an obvious solution. LV seems to intercept the Tab keystroke for its own moronic purposes. Quote Link to comment
Yair Posted February 22, 2013 Report Share Posted February 22, 2013 Any specific advice on how? ... LV seems to intercept the Tab keystroke for its own moronic purposes. Use the Key Down? event for the control and discard the event if it's a tab (ASCII 9, if memory serves). Quote Link to comment
ned Posted February 22, 2013 Report Share Posted February 22, 2013 Any specific advice on how? I've been looking into this and don't see an obvious solution. LV seems to intercept the Tab keystroke for its own moronic purposes. I put together a simplified version of the VI in the screenshot that shows how to do this: http://forums.ni.com/t5/LabVIEW/array-of-cluster/m-p/1822451#M625032 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.