Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(WPF Datagrid) How do I determine the Column Index of an Item

How do i return the column index of an item within a WPF Datagrid, when I click on a cell I'm using Visual Studio 2010/VB.Net

like image 467
Jason Hudson Avatar asked Jan 31 '11 16:01

Jason Hudson


1 Answers

You can use below code directly to get selected cells column index.

int index = datagrid.SelectedCells[0].Column.DisplayIndex;
like image 70
Agam Shah Avatar answered Sep 27 '22 17:09

Agam Shah