LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net datagridview -> datatable binding

Hi,
 
Unfortunately I started coding a LabVIEW app to bind a DataTable to a .NET DataGridView control via the DataSource property before I found this article:
 
 
As my LabVIEW code which doesn't work matches some C# which works correctly, I am assuming this issue "R&D (# 445I3UKZ)" remains unresolved.
 
Could someone please confirm this, or if it has been resolved point me in the right direction?
 
Many Thanks,
 
Steve Bale
 
0 Kudos
Message 1 of 19
(9,575 Views)
Hi Steve.

The short answer is yes, currently this is still being looked into by R&D.

I have been looking into the issue and so far this is what I can tell you:

In the world of .NET Windows.Forms programming, there is a feature called data binding that allows the programmer to easily associate the controls on a form with data from a database. In a Windows.Forms application, you can pretty much just hook it up and it works.

When you attempt to do the same things with Windows.Forms controls that are hosted on a LabVIEW front panel, however, it doesn't. The reason is simply that in Windows.Forms, the Form that hosts the controls provides a BindingContext, which is basically just a collection where the objects for managing the data binding are kept.

All I can say is that it is possible for the user to create a BindingContext and hook it up if you know how to do this. Since it is there by default in its native land of Windows.Forms, most programmers aren't even aware of it.

R&D are fully aware of this inconvenience but I am afraid I cannot give you any sort timescale on a resolution.

I hope this information helps you.
Message 2 of 19
(9,541 Views)
Does anybody know where i can get a example (that is running) showing how to create .Net Object (DataGridView) in LabView, add Data (Rows and Columns) into it and show thie "Table" on the front panel? ?!

Thank you!
0 Kudos
Message 3 of 19
(9,509 Views)
Pahe:
 
The link I included in the first post had a link to another thread which contains:
 
 
Is this what you're after?
 
Rich_Sills:
 
Thanks for your response, I will attempt to create a BindingContext as suggested 🙂
 
 
0 Kudos
Message 4 of 19
(9,494 Views)
0 Kudos
Message 5 of 19
(9,246 Views)

Check the code.

Unfortunately it doesn't support Chinese input yet! Who can help me?

Zhong Shengjun

zhongsj@smm.neu.edu.cn

 

 

Download All
0 Kudos
Message 6 of 19
(8,890 Views)

Zhong,

Have you checked to see if the .net datagridview supports Chinese? This may be a Microsoft.Net issue rather than LabVIEW?

Regards,

Steve

0 Kudos
Message 7 of 19
(8,885 Views)
Steve,
 
Thank you very much for your reply!
 
I did use MS Visual Studio and DataGridView worked very well in Chinese input. I think when DataGridView is hosted in LabVIEW panel, something  is changed on  the properties of DataGridView.
 
I checked all available properties of DataGridView, but I didn't find a properties that I can modify related to the Chinese input.
 
Attached is a interface which shows that the Chinese input works.
 
Still hope a solution for that.
 
Zhong Shengjun
0 Kudos
Message 8 of 19
(8,881 Views)
Zhong,
 
My guess would be that LabVIEW sets up the .net language settings to use the default (or more likely doesn't set them up), which is presumably US-English.
 
Im looking into a way of changing this. Perhaps using
 
System.Threading.Thread.CurrentThread.Culture
 
or
 
System.Globalization.CultureInfo(Lang);
 
Ill post if I find anything of interest
 
Steve. 
0 Kudos
Message 9 of 19
(8,866 Views)
Zhong,
 
I found this which may be of use
 
 
 
Also, attached is a VI that may contain the correct functions for you. Unfortunately I'm not in a position to test this myself.
 
Hope it helps.
 
Steve
0 Kudos
Message 10 of 19
(8,856 Views)