View Single Post
 
Old July 7th, 2005, 09:58 AM
demivolt demivolt is offline
Authorized User
 
Join Date: Aug 2004
Location: memphis, tn, .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting a DataGrid.DataSource to a DataView

All:
I am trying to convert a DataGrid's DataSource to a DataView during the preRender event of the same DataGrid. My "catch" gets an InvalidCastException (Specified Cast is not valid). The ultimate point of the conversion is to get a count of the number of records in the DataGrid. My single line of code:

Me.labTest.Text =
CType(DG1.DataSource, DataView).count.ToString() + " records found"

Can anyone help me with this?

TIA,

Demivolt