Jump to content

Multicolumn listbox


LMartin

Recommended Posts

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 by LMartin
Link to comment

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

Link to comment

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. :frusty:

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

Link to comment

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.

post-3989-0-37570700-1297704602_thumb.pn

Link to comment

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.

post-3989-0-37570700-1297704602_thumb.pn

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.)

  • Like 1
Link to comment
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.