From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically select a cell in DataGrid

Solved!
Go to solution

Hi all,

I am using Mike Kings DataGrid.

I was wondering if anybody has tried selecting/clicking a cell programmatically.

The .NET code is actually pretty straight forward, as I googled here:

DataGridView1.ClearSelection()            
DataGridView1.CurrentCell = DataGridView1.Rows(MyDesiredIndex).Cells(0)
DataGridView1.Rows(MyDesiredIndex).Selected = True

I haven't managed that in LabVIEW.

Has anybody else achieved something similar?

Cheers for any help!

Niko

0 Kudos
Message 1 of 4
(1,056 Views)

never mind. That repo has examples...


0 Kudos
Message 2 of 4
(1,050 Views)
Solution
Accepted by Universaldilletant

Haven't tested this, but it should be as simple as this:

wiebeCARYA_0-1663939200063.png

 

Message 3 of 4
(1,040 Views)

Oh wow, Wiebe, that already brings me a long way for understanding things with the datagrid!

Works like a charm!

Thanks a lot.

If anybody needs the snippet, it is attached here.

(I needed the error wires because my column 0 was invisible, so the original code threw an error)
Cheers, Niko
Snippet.png

Message 4 of 4
(1,012 Views)