LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net datagridview -> datatable binding

Steve,
 
Thanks for your help and vi code! However my LabView is 8.2 version, I will find a higer version to test it, or, please post the screen snapshot of the vi diagram.
 
Currently, If I copy Chinese from otherwhere to the .net input control, it works; if I type Chinese directly, the Chinese can't be displayed well.
 
I will come back once I have a solution or any new findings.
 
 
 
 
0 Kudos
Message 11 of 19
(2,774 Views)
Steav,
 
Thanks for your code, I checked and it doesn't work.
 
My understanding are as follows:
 
1. CultureAndRegionInfoBuilder class is used to build user specified culture, which Microsoft has not defined. It can't be used as a Culture selector.
   
     (1) If I use
 
               CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder("zh-cn", CultureAndRegionModifiers.Replacement);
 
         The error message in brief is "zh-cn already exist!"
 
     (2) Use your code (I post equivalent C# code here)
 
              CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder("zh-US", CultureAndRegionModifiers.None);
 
         The error message in brief is: 
 
             Inner Exception: System.InvalidOperationException: “Register”  failure,“NumberFormatInfo” 's “NumberFormat”  not defined
      (3) So, Before register, one has to  give some properties to CultureAndRegionInfoBuilder.  
 
2. I test a .Net CombBox in LabVIEW, Chinese Input doesn't work as well. The Chinese can be pasted in the combobox, but can't be inputed!
 
3. I tried to write a C# fucntion, and call this function DLL to add list of ComboBox, and set the culture, the list works, but Chinese input still doesn't work.
 
        public static void AddTextArrayToComboBox(String[] strArray,ComboBox comboBox)
        {
            try
            {
                comboBox.Items.AddRange(strArray);
                System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-cn");
                //  CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder("zh-cn",
                //  CultureAndRegionModifiers.Replacement);
                //builder.Register();
            }
4. All codes include VIs, and C# source and DLL are attached.
 
 
 
 
0 Kudos
Message 13 of 19
(2,758 Views)
This sounds like it's more of a .NET issue rather than a LabVIEW issue. You may have better luck on .NET forums, such as the MSDN forums.
0 Kudos
Message 14 of 19
(2,754 Views)

Smercurio,

Thank's for your reply, I will try to ask that in a .Net forum.

However, my topic is How to Use .Net control in LabVIEW panel.

To find a person who knows LabVIEW and knows something on .Net is easy. On the other hand? Few .Net programmer knows LabVIEW.

I will ask NI service and if I got it I will share the information.

I am write a dadabase program using LabVIEW, and I think DataGridView is a good method to display and edit a data table. Now DataGridView works, but I can't INPUT Chinese into it. I can paste Chinese into it. I use .Net controls for long, and there was no problem to input Chinese in MS Visual Studio.

 

0 Kudos
Message 15 of 19
(2,739 Views)
I'm a little confused. Your last post seemed to imply that you couldn't get the Chinese input to work properly in C# either. That's why I said that it sounds like it's more of a .NET issue. Unfortunately, I don't have a Chinese version of Windows, so there's no way for me to test this.
0 Kudos
Message 16 of 19
(2,733 Views)
Smercurio,
 
Thank for youe comment!
 
I am sorry that I didn't express myself well. Because I am familiar with .Net programming, so when I program in LabVIEW, I call .Net DLLs to do some work. For me, it is more simple than to use LabVIEW to do it.
 
In the .Net ComboBox example, I use a C# DLL to add a string array to a ComboBox list.
 
Of cause, LabVIEW has it's own ComboBox, so, here just a test for using .Net control in LabVIEW.  ComboBox in .Net has no advantage, but DataGridView has much advantage than LabVIEW table. It can be use both for input and display.
 
Thanks for your attantion!
 
 
 
0 Kudos
Message 17 of 19
(2,731 Views)
Hello, have you finally solved the garbled problem?
0 Kudos
Message 18 of 19
(876 Views)
Hello, have you finally solved the garbled problem?
0 Kudos
Message 19 of 19
(875 Views)