cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically select a cell in DataGrid

SOLVED
Solved!

Programatically select a cell in DataGrid

Message contains a hyperlink

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

Tags (2)
3 REPLIES 3
wiebe@CARYA
Knight of NI

Re: Programatically select a cell in DataGrid

never mind. That repo has examples...


wiebe@CARYA
Knight of NI
Solution

Re: Programatically select a cell in DataGrid

Message contains an image

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

wiebeCARYA_0-1663939200063.png

 

Highlighted

Re: Programatically select a cell in DataGrid

Message contains an image

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