Casting TableCell to DropDownList in GridView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobertTheProgrammer
    New Member
    • Aug 2007
    • 58

    #1

    Casting TableCell to DropDownList in GridView

    This may be a daft question, but I'm not able to find an answer yet.

    In my GridView object, I have a DropDownList object with the OnSelectedIndex Changed set to call my C# code. In the C# code, I get some data based upon what the user picked and set the text in some other cells in the row. This is done with the line:

    row.Cells[6].Text = tutype;

    where tutype is the new value. Works great for TextBox fields. My problem is that one of the cells I want to populate is another DropDownList, not a TextBox. A call like above won't work because it converts the cell from a DropDownList to a TextBox. So I figure I just have to cast the cell to a DropDownList and set the SelectedValue. But somewhere I'm being daft and can't seem to figure out the cast. Please help.

    Robert
Working...