Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Update for Datagrid problem

Author  Topic 

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2005-11-16 : 09:41:06
I'm using the first data column's EditItem Template to allow the user to edit 6 fields. This has allowed us to get the datagrid to expand vertically and increase the font size too. I'm using an HTML table control to hold the text boxes and dropdownlists so it's structured, but now...on the UpdateCommand, I can't get the cast correct and/or find the control to get the associated data for the Update statement. The error and line are:
"Specified Cast is not valid"

txtType = CType(e.Item.Cells(4).Controls(2), TextBox).Text

Can/should I even use an HTML control to hold the items in the EditItem template?

Any suggestions are welcome!

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2005-11-16 : 10:55:28
I figured out the above scenario...add ".ToString()"

Now, I get an error on the line of code:

Dim ddlP3ResCode As DropDownList = CType(e.Item.Cells(4).Controls(7), DropDownList)


This is the third row / second column of the HTML table.
I have the first dropdownlist working correctly, which is the first row / second column, and it's line of code is:
Dim ddlName As DropDownList = CType(e.Item.Cells(4).Controls(3), DropDownList)

Does the tab index not make a different when using the integer parameter for the Controls( )?

Any suggestions are welcome! Any way to find out where this "problem" ddl is?
Go to Top of Page
   

- Advertisement -