I have a datagridview and a status strip on my form. When I click a row or cell, the label from the status strip should change according to it's row number. My datagridview is being generated at run time by a dataset.
AngelicOne
4
Posting Whiz
Recommended Answers
Jump to PostMany Click events of the DataGrridView show a DataGridViewCellEventArgs
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { // e.RowIndex and e.ColumnIndex }
This class gives you access to the row and column.
Jump to PostYes you do:
if(dataGridView1.Rows.Count > 0) { //your code }
All 6 Replies
ddanbe
2,724
Professional Procrastinator
Featured Poster
Mitja Bonca
commented:
You are welcome :)
+2
AngelicOne
commented:
thanks
+1
Mitja Bonca
557
Nearly a Posting Maven
ddanbe
commented:
Thanks for the addition!
+8
AngelicOne
4
Posting Whiz
ddanbe
2,724
Professional Procrastinator
Featured Poster
AngelicOne
4
Posting Whiz
Mitja Bonca
557
Nearly a Posting Maven
AngelicOne
commented:
thanks
+1
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.