Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - e.Row.Cells().Text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

e.Row.Cells().Text

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: e.Row.Cells().Text
    Posted: 12 November 2005 at 12:58am
Okay, I have really narrowed my problem down. When I just pass the stored procedure through, it generates in the GridView fine. But when I attempt to perform manipulation on the GridView by using e (which is GridViewRowEventArgs) I get an error. For some reason ASP.NET 2.0 thinks the GridView doesn't contain these cells or values or something akin to that. Basically what I am doing is:
e.Row.Cells(1).Text = "Hello World!"
But it thinks the cells don't exist.
David.Ouch
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2005 at 1:32am
I discovered that for some reason e.Row.Cells(6) is not being viewed as a DataControl of RowType DataRow (DataControlRowType.DataRow). Any ideas why this might be?
David.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2005 at 8:06pm
I fixed it. Basically there were two problems:
(1) I wasn't making sure that the row I was handling was a DataRow. I fixed this by adding:
If e.Row.RowType = DataControlRowType.DataRow Then
(code modifying GridView columns)
End If
(2) While troubleshooting I had changed e.Row.Cells(6).Text to e.Row.Cells(6).ToString, which was passing the entire cell rather than just the text, so I changed it back to .Text.
David.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.