TimBPowell
asked on
DataGridView Problem getting Column and Row Number
I have always used the Standard .net Datagrid but need to use the Datagridview on this occassion. My problem is simple but I have spent several hours on it so not that simple to me. In a datagrid to find the current column I always used datagrid.currentcell.colum nnumber or datagrid.currentcell.rownu mber.
These don't exist for datagridview so I thought i'd try datagridview.currentcell.c olumnindex but I always get 0.
I have my grid setup with around 20 rows and 60 columns but just cannot find the column or row number.
I know it must be simple but I need your help.
These don't exist for datagridview so I thought i'd try datagridview.currentcell.c
I have my grid setup with around 20 rows and 60 columns but just cannot find the column or row number.
I know it must be simple but I need your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DataGridView1.CurrentCell. ColumnInde x works fine for me. You might also like to try DataGridView1.CurrentCellA ddress.X
>> DataGridView1.CurrentCell. ColumnInde x works fine for me
For me too webtubbs
For me too webtubbs
ASKER
Thanks for your help. Thought it was easy. Just had brain lock this morning!
X = columnindex
All zero based