Gridview find control problem
-
Wednesday, April 11, 2012 9:32 PM
Hi Gents,
My problem is how to assgin data table row cell to gridview control?
Please find below code:
gridview.Rows[(int)dt.Rows[J]["index"]].Cells[3].Text = (string)dt.Rows[J]["uom"];
Please find above code's errors.
Nothing is impossible
- Edited by BinShehab Wednesday, April 11, 2012 9:35 PM
All Replies
-
Monday, April 16, 2012 6:35 AMModerator
Hi BinShehab,
I find you use letter "J" in your code, but it isn't support, it only support “int” type. You should do it like the following.
gridview.Rows[(int)dt.Rows[0]["index"]].Cells[3].Text = (string)dt.Rows[0]["uom"];
In the code, number 0 is stand for first row.
Thanks,
Jack
- Marked As Answer by Jack-GaoMicrosoft Contingent Staff, Moderator Sunday, April 22, 2012 11:21 AM
-
Wednesday, May 30, 2012 6:44 AMI passed row index (J) from another function
Nothing is impossible

