datarowview vs datarow

hey all,

DataRowView drv = (DataRowView)((GridViewRow)lbl.NamingContainer).DataItem;

i found this snippet on the net which works correctly in its context. It's
datasource is coming from a Typed DataSet.

Well, i modified the GridView's DataSource to use an UnTyped DataSet but i'm
getting an error saying
"Unable to cast object of type 'System.Data.DataRow' to type
'System.Data.DataRowView'.

Can someone please confirm why this is so? or if this makes any sense?

thanks,
rodchar
rodchar [ Mo, 28 Januar 2008 16:21 ] [ ID #1917888 ]

RE: datarowview vs datarow

sorry bout this, i had a brain cramp. the datasource was using a dataview of
the typed dataset. problem solved.

"rodchar" wrote:

> hey all,
>
> DataRowView drv = (DataRowView)((GridViewRow)lbl.NamingContainer).DataItem;
>
> i found this snippet on the net which works correctly in its context. It's
> datasource is coming from a Typed DataSet.
>
> Well, i modified the GridView's DataSource to use an UnTyped DataSet but i'm
> getting an error saying
> "Unable to cast object of type 'System.Data.DataRow' to type
> 'System.Data.DataRowView'.
>
> Can someone please confirm why this is so? or if this makes any sense?
>
> thanks,
> rodchar
>
>
rodchar [ Mo, 28 Januar 2008 17:58 ] [ ID #1917915 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » datarowview vs datarow

Vorheriges Thema: asp.net v1.1.4322 CS0016
Nächstes Thema: InitializeNewComponent doesn't work on webcontrol