Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

trying to access the row.databound

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WebBuilder451 - 28 Aug 2007 20:24 GMT
this fires from a gridview and this type of construction works ok in vb.net
but i keep  getting:
CS0021: Cannot apply indexing with [] to an expression of type 'object' if i
use ]
and: CS0118: 'System.Web.UI.WebControls.GridViewRow.DataItem' is a
'property' but is used like a 'method' when i use ().

   protected void gv_Portfolio_RowDB(object sender, GridViewRowEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow) {
           Response.Write(e.Row.DataItem("NEWPFXO"));
       }
   }

I'm sure it's a simple one.

Signature

thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes

Peter Bromberg [C# MVP] - 28 Aug 2007 21:24 GMT
((DataRowView)e.Row.DataItem).Row["NEWPFXO"]

Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> this fires from a gridview and this type of construction works ok in vb.net
> but i keep  getting:
[quoted text clipped - 11 lines]
>
> I'm sure it's a simple one.
WebBuilder451 - 28 Aug 2007 23:06 GMT
i did it this way: (string)DataBinder.Eval(gvr.DataItem,"NEWPFXO")
I like your way better, Thank  You!
Signature

thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes

>  ((DataRowView)e.Row.DataItem).Row["NEWPFXO"]
>
[quoted text clipped - 13 lines]
> >
> > I'm sure it's a simple one.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.