Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid data not there, but shows up in webpage

Reply
Thread Tools

datagrid data not there, but shows up in webpage

 
 
Narshe
Guest
Posts: n/a
 
      11-15-2005
I have a datagrid that gets bound, and on itemdatabound, there is no
data. If I look at datagrid.items, there is no data in the items
either. When the page is displayed, the datagrid has all the data in
it.

What might be causing this?

 
Reply With Quote
 
 
 
 
Narshe
Guest
Posts: n/a
 
      11-15-2005
I've figured one thing out. It works if the columns are BoundColumns,
but if they are ItemTemplates, this doesn't work.

How do I get row data out of rows that are item templates?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RWx0b24gVw==?=
Guest
Posts: n/a
 
      11-15-2005
In datagrid_ItemDataBound event you can get data from e.Item.ItemData. For
example, if you use DataView, DataTable, or DataSet, as data source, you can
cast e.Item.ItemData to DataRowView object then retrieve each data in the
DataRowView:

DataRowView drv = (DataRowView)e.Item.ItemData;
string desc = drv[“desc”].ToString();


HTH

Elton Wang


"Narshe" wrote:

> I've figured one thing out. It works if the columns are BoundColumns,
> but if they are ItemTemplates, this doesn't work.
>
> How do I get row data out of rows that are item templates?
>
>

 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      11-16-2005
In DataGrid did you set AutoGenerateColumns = False or True?
Patrick


"Narshe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I've figured one thing out. It works if the columns are BoundColumns,
> but if they are ItemTemplates, this doesn't work.
>
> How do I get row data out of rows that are item templates?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE shows false and Firefox shows true Gianni Javascript 3 07-10-2009 09:18 PM
cause webpage one to reload when webpage two is closed. Paul ASP .Net 14 06-19-2008 03:02 PM
check if a webpage is forwarding to a other webpage martijn@gamecreators.nl Python 1 09-06-2005 02:27 PM
Session var in page_load shows old value, buttonclick shows new . Whats wrong gce ASP .Net 0 05-07-2005 06:50 AM
Home page on localhost shows script instead of webpage =?Utf-8?B?SGVtaWw=?= ASP .Net 3 01-11-2005 03:59 AM



Advertisments