Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   cannot use DataRowView in ONItemBound event if datagrid datasource is Datareader? (http://www.velocityreviews.com/forums/t778310-cannot-use-datarowview-in-onitembound-event-if-datagrid-datasource-is-datareader.html)

rockdale.green@gmail.com 06-07-2006 08:50 PM

cannot use DataRowView in ONItemBound event if datagrid datasource is Datareader?
 
private void dgrid_OnItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType ==ListItemType.Item||e.Item.ItemType
==ListItemType.AlternatingItem)
DataRowView drv = (DataRowView)e.Item.DataItem;

it caught error.


but if I change the datasource to DataTable then it is ok.


Is it true we cannot use DataRowView in ONItemBound event if datagrid
datasource is Datareader?


thanks
-Rockdale



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

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