*****************************
The problem is, that I've to redirect the user to another page when he selects a value
in the dropdownlist, also bringin the ID of the first field.
In codebehind I use:
Protected Sub ddlMese_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim ddlMonth As DropDownList = CType(sender, DropDownList)
Dim dgi As DataGridItem = CType(ddlMonth.Parent.Parent, DataGridItem)
Dim ChoosenMonth As DropDownList = CType(dgi.FindControl("MonthDropDown"), DropDownList)
' this one should contain the value but it's always empty!!! **********
Dim id As Label = CType(dgi.FindControl("lblID"), Label)
A final note... I don't understand why the value of the dropdownlist it's catched, but
all seem correct...the label is founded ... but the text of the label is always empty!!
Please, if anyone has any clue it would be really appreciated...thanks a lot!!!
Simone
That sounds like a lot of complexity. Are you doing in-line editing? it may be more user-friendly to just have an 'Edit' column and put all the data input on one page.
As far as retrieving values goes, I think the problem is here:
Code:
CType(dgi.FindControl("lblID"), Label)
I'm still trying to figure this out, but I believe FindControl only looks at the current level (it doesn't drill down). So your code is searching the DataGrid for your label. All the datagrid returns is a bunch of Items, Cells, Rows, and Columns. Try digging down manually:
Bookmarks