Hi, I have added dropdownlist for the each raws in a radgrid. I have managed to add "low,normal and high options inside the dropdownlist but". I can not get the selected value. in the dropdownlist. I used the code below;
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If TypeOf e.Item Is Telerik.WebControls.GridDataItem Then
Dim item As Telerik.WebControls.GridDataItem = DirectCast(e.Item, Telerik.WebControls.GridDataItem)
Dim ddl As DropDownList = DirectCast(item("Temp").FindControl("DropDownList1"), DropDownList)
ddl.Items.Add("Low")
ddl.Items.Add("Normal")
ddl.Items.Add("High")
MsgBox(ddl.SelectedValue)
End If
End Sub
ddl.SelectedValue only gives me the Low option, when i run the page but when i select normal or high or low again. It doesnt seem to be doing anything so i also added the code below.
Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged
MsgBox(ddl.SelectedValue)
End Sub
But still no use. So is there a way of getting the selected item of the dropdownlist in radgrid?
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If TypeOf e.Item Is Telerik.WebControls.GridDataItem Then
Dim item As Telerik.WebControls.GridDataItem = DirectCast(e.Item, Telerik.WebControls.GridDataItem)
Dim ddl As DropDownList = DirectCast(item("Temp").FindControl("DropDownList1"), DropDownList)
ddl.Items.Add("Low")
ddl.Items.Add("Normal")
ddl.Items.Add("High")
MsgBox(ddl.SelectedValue)
End If
End Sub
ddl.SelectedValue only gives me the Low option, when i run the page but when i select normal or high or low again. It doesnt seem to be doing anything so i also added the code below.
Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged
MsgBox(ddl.SelectedValue)
End Sub
But still no use. So is there a way of getting the selected item of the dropdownlist in radgrid?