Datagrid Girl

Marcie, ASP.NET Datagrid Blogger Girl

DropdownLists in a Datagrid, and DataReaders

When people on the Forums ask about using DropDownLists inside a Datagrid, I usually point them to my pal Alex Lowe's code sample here.  Yesterday someone had some trouble implementing this sample, because they were using a DataReader and the sample is based on a DataSet.

Word to the wise, when using DataReaders, you need to change this line:
Dim myRow As DataRowView = CType(e.Item.DataItem, DataRowView)

to:
Dim myRow As System.Data.Common.DbDataRecord= CType(e.Item.DataItem, System.Data.Common.DbDataRecord)

Happy Datagridding!

Comments

Scott Watermasysk said:

We need to get you your own template :D
# March 13, 2003 2:10 PM

Datagrid Girl said:

Yep, I'd love a pink skin! (for the blog, that is)
# March 13, 2003 2:22 PM

John Raezer said:

Any idea what line to use for Dim myRow when are are binding from a ListDictionary?

jraezer@yahoo.com
# August 12, 2003 7:02 AM

Bob MacLeod said:

Thank you!! I ate up a ridiculous amount of time trying to resolve the DataReader error you refer to.
# December 11, 2003 1:01 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)