Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
if (dataGridView3.CurrentRow{4} >= 0)
            {
                pictureBox26.Visible = true;
            }


This Give me Error
Posted
Updated 29-May-15 10:05am
v2
Comments
ZurdoDev 29-May-15 13:20pm    
What are you trying to do?
Michael_Davies 29-May-15 13:35pm    
How many rows are there in the datagridview? Check the Row Count and remember it is zero based indexing so row 4 by human counting (1 based indexing) is index 3.
Richard Deeming 29-May-15 13:47pm    
Probably because you're trying to use braces ({4}) instead of square brackets ([4]).

If not, click the "Improve question" link and post the missing details - in particular, the details of the error you're getting.
Maciej Los 29-May-15 16:07pm    
Please, post it as an answer and let notify me ;)
Richard Deeming 29-May-15 16:09pm    
It's not clear whether that was the answer, or if it was Michael's suggestion that solved the problem. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900