A
Andy B
I have a detailsView (replaced the formview with it) thinking it would help
me fix my control access in a formview problem. Well, I don't think .net
knows how to count. Here is what I have:
I am trying to display the value of a certain cell in a label control. Say,
NewsId for my example. In this example, NewsId should be 14. I took this
line and used it to find out how many rows there were:
DateConfirmLabel.Text = EditNewsForm.Rows.Count.ToString();
I got 4. Ok no big deal. I want row 2, cell 2, so I wrote this:
DateConfirmLabel.Text = EditNewsForm.Rows[1].Cells.Count.ToString();
When I run it to see how many cells are in the row, I get index out of range
error when running the page. I found that it was the Rows[1] that was making
the problem. Any idea why this happens?
me fix my control access in a formview problem. Well, I don't think .net
knows how to count. Here is what I have:
I am trying to display the value of a certain cell in a label control. Say,
NewsId for my example. In this example, NewsId should be 14. I took this
line and used it to find out how many rows there were:
DateConfirmLabel.Text = EditNewsForm.Rows.Count.ToString();
I got 4. Ok no big deal. I want row 2, cell 2, so I wrote this:
DateConfirmLabel.Text = EditNewsForm.Rows[1].Cells.Count.ToString();
When I run it to see how many cells are in the row, I get index out of range
error when running the page. I found that it was the Rows[1] that was making
the problem. Any idea why this happens?