bang head here Posted February 4, 2003 Posted February 4, 2003 I can't believe I'm having this much trouble moving into .NET. Anyway, I'm getting a Cast error when reading in the text of a selected item when updating a record in a DataGrid. Dim ContainerName As String = e.Item.Cells(2).Controls(0).DropDrownList.SelectedItem.Text That's the most recent look of what I've tried to do. I think I've tried about every combination to get the value into a variable with no luck at all. There is a value for this item, so I just need to dump it into a string. I know it's not hard and I'm just having the "newbie blues" with .NET right now. Regards. Quote
bang head here Posted February 4, 2003 Author Posted February 4, 2003 Even this won't work: Dim TempList As DropDownList Dim TempValue As String TempList = E.Item.FindControl("selContainerName") TempValue = TempList.SelectedItem.Value The selContainer name is being created when editing the grid, but I get an "Object reference not set to an instance of an object" error when I try to pull the value. Any thoughts? Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.