Hi!, I am using framework 2.0 and Visual Visual Web Developer Express.
In a gridview, when it is in editmode, I have a dropdownlist in a
templatefield. The problem is that it show always the first item in the list
and not the current one correspondin to the value saved in the database....
How can I solve the problem? I have read about the event itemdatabound of
the gridview, but if I try the code below:
Sub GridView1_ItemDataBound(ByVal Sender As Object, ByVal e As
DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.EditItem Then
Dim ddl As DropDownList
ddl = CType(e.Item.FindControl("comboTipoIndennita"), DropDownList)
ddl.SelectedIndex =
ddl.Items.IndexOf(ddl.Items.FindByText(DataBinder. Eval(e.Item.DataItem,
"comboTipoIndennita")))
End If
End Sub
it says me that the gridview can't handles that event...
Thanks in advance and sorry for my english...
Marco