Click here to Skip to main content
14,668,213 members
Rate this:
Please Sign up or sign in to vote.
See more:
when I write this code
GridViewPays.CurrentCell = GridViewPays.Rows[1].Cells[0];
it selects the second row
but when I change indexrow to 0
GridViewPays.CurrentCell = GridViewPays.Rows[0].Cells[0];
it doesn't work
what' the problem? I have number sequence column in same datagridview
Posted
Comments
j snooze 31-Jul-14 14:59pm
   
I did a basic form with a gridview and setting the current cell to Rows[0].Cells[0] worked for me. Not sure what "doesn't work" means. Does it error or just not select the current cell?
frostcox 31-Jul-14 17:25pm
   
When you say doesn't work what do you mean? Do you get an error or is there no value in that cell?
Sibeesh Venu 1-Aug-14 1:01am
   
Please paste the error here, if you are getting one.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

try
GridViewPays.Rows[0].Selected = true;


Find more here[^]
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100