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!
Published Thursday, March 13, 2003 12:38 PM by datagridgirl

Comments

# re: DropdownLists in a Datagrid, and DataReaders

We need to get you your own template :D

Thursday, March 13, 2003 2:10 PM by Scott Watermasysk

# re: DropdownLists in a Datagrid, and DataReaders

Yep, I'd love a pink skin! (for the blog, that is)

Thursday, March 13, 2003 2:22 PM by Datagrid Girl

# re: DropdownLists in a Datagrid, and DataReaders

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

jraezer@yahoo.com

Tuesday, August 12, 2003 7:02 AM by John Raezer

# re: DropdownLists in a Datagrid, and DataReaders

Thank you!! I ate up a ridiculous amount of time trying to resolve the DataReader error you refer to.

Thursday, December 11, 2003 1:01 PM by Bob MacLeod

Leave a Comment

(required) 
(required) 
(optional)
(required)