E
Evan Camilleri
I managed to do a DropDownList in Datagrid on Edit (normally, the templates
puts a label). My problem is that I cannot initialize it when I do the
edit.
I am doing the following
' Select the current row for 'edit mode'
dg.EditItemIndex = e.Item.ItemIndex
BindDataGrid()
' Select default dropdown option, as earlier
Dim ddl As DropDownList
ddl = CType(dg.Items(dg.EditItemIndex).FindControl("ddlJobType"),
DropDownList)
Parent.BindDataReader("tb_JobTypes", "jtp", ddl) '>>> binds the
dropdownlist to the table
ddl.SelectedIndex =
ddl.Items.IndexOf(ddl.Items.FindByValue(e.Item.Cells(2).Text)) '>>>> NOT
WORKING
What am I doing wrong?
puts a label). My problem is that I cannot initialize it when I do the
edit.
I am doing the following
' Select the current row for 'edit mode'
dg.EditItemIndex = e.Item.ItemIndex
BindDataGrid()
' Select default dropdown option, as earlier
Dim ddl As DropDownList
ddl = CType(dg.Items(dg.EditItemIndex).FindControl("ddlJobType"),
DropDownList)
Parent.BindDataReader("tb_JobTypes", "jtp", ddl) '>>> binds the
dropdownlist to the table
ddl.SelectedIndex =
ddl.Items.IndexOf(ddl.Items.FindByValue(e.Item.Cells(2).Text)) '>>>> NOT
WORKING
What am I doing wrong?