Vb.net datagridview which row is selected




















Add a comment. Active Oldest Votes. So instead of checking for current row, if you want to do this check in Click event of a Button , it's better check for SelectedRows : C if dataGridView1.

NewRowIndex MessageBox. SelectedRows 0. Improve this answer. Reza Aghaei Reza Aghaei k 13 13 gold badges silver badges bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Explaining the semiconductor shortage, and how it might end.

Register to vote on and add code examples. Join our developer community to improve your dev skills and code like a boss! No Good? I am not saying this is the only solution, there might be some other, explore it.

Karthik, thank you. I think you're right about the CurrentCell property not working as expected. I finally found a way to make this work, and managed to avoid selecting a different row and then back: VB. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML. Existing Members Sign in to your account. This email is in use. Do you need your password? Submit your solution! When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.

If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome. Don't tell someone to read the manual.

Chances are they have and don't get it. Provide an answer or move on to the next question.



0コメント

  • 1000 / 1000