Click here to Skip to main content
16,015,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to know what is the exact meaning for this line and wheat it does. Pls someone give me clear explanation on this.

C#
Mygrid.Rows[e.RowIndex].Cells[0].Text;
Posted

Gridview bind data in Table format. it is define format like Rows and Columns

------------------
id | name |
----|------------|
1 | Rakesh |
----|------------|
2 | Joseph |
----|------------|

e.RowIndex

This is Which row you have been clicked in the grid view

.Cells[0].Text;
This Mean 0 th cell Value

Mygrid.Rows[e.RowIndex].Cells[0].Text;

This mean the N th row of 0 th cell value in the Gridview

(ie) if you clicked second row then the result would be second row first cell value - 2

(ie) if you want the values of cell 1 of second row of above grid so you can write

Mygrid.Rows[1].Cells[1].Text;

the Result would be : Joseph
 
Share this answer
 
v2
Comments
ajithk444 24-Jul-12 6:37am    
thanks fr ur help...
http://www.codeproject.com/Questions/427114/Deleting-a-row-in-Grid-View
pls try helping me in this question also...
Gets the Text property (a string) of the grid's cell at row e.RowIndex, and column 0 (the first column). Does nothing with such property.
 
Share this answer
 

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