Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   datagrid data not there, but shows up in webpage (http://www.velocityreviews.com/forums/t113566-datagrid-data-not-there-but-shows-up-in-webpage.html)

Narshe 11-15-2005 03:49 PM

datagrid data not there, but shows up in webpage
 
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?


Narshe 11-15-2005 04:14 PM

Re: datagrid data not there, but shows up in webpage
 
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?


=?Utf-8?B?RWx0b24gVw==?= 11-15-2005 07:40 PM

Re: datagrid data not there, but shows up in webpage
 
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?
>
>


Patrick.O.Ige 11-16-2005 08:28 AM

Re: datagrid data not there, but shows up in webpage
 
In DataGrid did you set AutoGenerateColumns = False or True?
Patrick


"Narshe" <narshe@gmail.com> wrote in message
news:1132071270.072895.268420@g49g2000cwa.googlegr 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?
>





All times are GMT. The time now is 08:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.