stepping thru the GridView1_RowDataBound event

G

Guest

hey all,
when i step thru the above event here's what I get for RowTypes

?e.Row.RowType

Header
DataRow (this is in red in the watch window)
DataRow (and this is in black)
Footer

what's the difference in colors or why 2 DataRows for one record?

thanks,
rodchar
 
G

Guest

what's the difference in colors or why 2 DataRows for one record?
I think that you are a little confused here. There is only one DataRow per
record, however the Watch window does change color on every iteration of
e.Row.RowType. That is an interesting observation and it is a result of the
IDE color coding variables that have been changed (black for no change, red
for change).

So your output should be:

e.Row.RowType Header (Black)
e.Row.RowType DataRow (Red)
e.Row.RowType DataRow (Black)
e.Row.RowType Footer (Red)

for a table that has 2 rows.

Since the base types for the row is the same for header, datarow and footer,
the behaviour that you see is consistent. The first time around a new Datarow
row of type header is created, hence the black color. Then on the second
iteration, that variable's type gets changed to dataRow, hence the red color.
On the third iteration, the type stays the same, hence the black color
(unchanged). On the last iteration, the type gets changed to Footer, hence
the red color (changed).

Hope that gives you a clearer understanding of what the changing colors mean.

--
With Regards

Shailen Sukul
Architect
(BSc MCTS, MCSD.Net MCSD MCAD)
Ashlen Consulting Service P/L
(http://www.ashlen.net.au)
 
G

Guest

No probs mate.
Just a reminder to close this post if you are happy with the answer.
Thanks.

--
Good luck!

Shailen Sukul
Architect
(BSc MCTS, MCSD.Net MCSD MCAD)
Ashlen Consulting Service P/L
(http://www.ashlen.net.au)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top