ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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
(2,281 Views)

never mind. That repo has examples...


0 Kudos
Message 2 of 4
(2,275 Views)
Solution
Accepted by topic author Universaldilletant

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

wiebeCARYA_0-1663939200063.png

 

Message 3 of 4
(2,265 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
(2,237 Views)