Radgrid edit mode rocks with a special formtemplate, it this might be simple but cannot figure out. I need to be able to postback while in edit mode, i have 2 dropdownlists and need the second to be filled by the first while in edit mode. I can fill them to existing values but if a user need to change them they stay with existing values and don't change becuase of no postback. So basically if they pick another make I need the models to refresh themselves based on the make. If this is not possible in edit mode I will take it out to a panel and do it here.
Protected Sub myRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
Dim editedItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim Loc As DropDownList = DirectCast(editedItem.FindControl("ddlLocation"), DropDownList)
Dim make As DropDownList = DirectCast(editedItem.FindControl("ddlMake"), DropDownList)
Dim model As DropDownList = DirectCast(editedItem.FindControl("ddlModel"), DropDownList)
'Get the Location filled
sql = "Select intDurableId, strLocation from Drat_J6DurableInfo Order by strLocation"
Loc.Items.Add(New ListItem("Pick Location", "0"))
buildDD(sql, Loc)
Loc.SelectedValue = DirectCast(DataBinder.Eval(e.Item.DataItem, "intDurableId").ToString(), String)
Loc.DataBind()
'Get the make of the item
sql = "Select intmakeId, strmake from Drat_Make order by strmake"
make.Items.Add(New ListItem("Pick Make", "0"))
buildDD(sql, make)
make.SelectedValue = DirectCast(DataBinder.Eval(e.Item.DataItem, "intMakeId").ToString(), String)
make.DataBind()
'Get the Model of the item
sql = "Select intModelId, strModel from Drat_Model order by strModel"
model.Items.Add(New ListItem("Pick Model", "0"))
buildDD(sql, model)
model.SelectedValue = DirectCast(DataBinder.Eval(e.Item.DataItem, "intModelId").ToString(), String)
model.DataBind()
End If
End Sub