LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.Net Datagrid doesn't work as expected

I'm trying to use a .NET DataGrid in my LabVIEW application (at this point it's supposed to be a "simple" proof-of-concept), but I cannot get it to work.  I borrowed some code on the discussion forums, but cannot seem to tailor it to my needs.  I've only changed minor portions of the code, but the container only appears on the screen sometimes (othertimes it appears invisible) and never with any data populated.  Please let me know what I am doing wrong.  All I want to do is populate a table so the user can "click-sort" as they would expect to be able to do.
 
Dan
 
PS--I apologize for what I admit is abominable layout, flow, and style.  I swear it will be clean when it is released.
0 Kudos
Message 1 of 4
(3,533 Views)
Dan,

After taking a look at the code you posted, I am a little unsure as to how the DataGrid should properly be populated. Would it be possible to provide some comments for the code that you have modified? Was the code you downloaded functioning correctly before your modifications? If we could see a basic example of a working DataGrid, we should then be able to get up and running with your application. Additionally, the .NET container always appears visible when run on my computer. Under what conditions does this control appear invisible for you?

.NET objects are actually Microsoft objects – containers simply allow us to use them in LabVIEW. I would suggest reading through the Microsoft MSDN Library concerning the DataGrid object. This should detail all the available methods and properties accessible to the .NET object through LabVIEW (or any .NET programming language). This should give you an idea on how to populate and sort the table as you need. I hope this is useful for you! Thanks,

Mike
0 Kudos
Message 2 of 4
(3,521 Views)
Duffman...oh yeah!
 
Like I said, sorry for the complete crap code.  Proof of concept.  Anyway, the idea was to take the input cluster array and show the First and Last Names of each element on its own individual row.  The only reason I want to use a .NET control is so I can have sorting ability built in.   Otherwise I'd have to program it, which would be gross.  I do have a sample VI that I got off the forums here that does work consistently.  I can't figure out why one works and the other doesn't.
 
As far as when it goes invisible on my screen...it's everytime now.  That VI also has taken to not redrawing the front panel when opened.  I can add new controls, but I usually can't see them or move the front panel scroll bars.  Block diagram works fine. 
 
Dan
 
PS--I have attached the sample VI from the forum.
0 Kudos
Message 3 of 4
(3,517 Views)
Dan,

It does seem like you have a very similar code structure than the example you posted below.  One thing that I noticed was that the data type is set after the data is populated in the example from NI.com, so that might be something to check.  It seems that the order of execution is very important in the application, so I would follow the error cluster with highlight execution on to make sure you do things in the same order.  I would also suggest trying to first do a form and get everything working as a seperate window and then get everything integrated into a container. 

Hope this helps!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 4 of 4
(3,490 Views)