I have a drop down and a rad combo box. While running the application, I go into edit mode, click on the drop down and change the selected value. I then click on the "update" link next to the line.
I get the handle on the dropdown list or rad combo box in UpdateCommand event, but when I examine the SelectedValue, it is still the same as before. How can I access the changed value in this case? What am I missing?
Thanks.
Suresh
Here is the code I am using:
<telerik:GridTemplateColumn DataField="CostCenterName" HeaderText="Adj Cost Center Name" UniqueName="CostCenterName">
<ItemTemplate>
<%
#DataBinder.Eval(Container.DataItem, "CostCenterName")%>
</ItemTemplate>
<ItemStyle Width="300px" />
<EditItemTemplate>
<telerik:RadComboBox DataTextField="CostCenterName"
DataValueField="CostCenterName"
OnTextChanged="RadComboBoxAdjustedCC_TextChanged"
OnItemsRequested="RadComboBoxAdjustedCC_ItemsRequested"
EnableLoadOnDemand="True"
ID="RadComboBoxAdjustedCC"
runat="server"
Height="140px"
Width="220px"
SelectedValue='<%#Bind("CostCenterName")%>'
DataSourceID="ObjectDataSourceGetCostCenters">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Site" HeaderText="Site" UniqueName="Site">
<ItemTemplate>
<%
#DataBinder.Eval(Container.DataItem, "Site")%>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownListSite" runat="server"
SelectedValue='<%#DataBinder.Eval(Container.DataItem, "Site")%>' >
<asp:ListItem Value="C">BAH</asp:ListItem>
<asp:ListItem Value="G">Govt.</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</telerik:GridTemplateColumn>
VB Code:
Protected Sub RadGridEmpData_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridEmpData.UpdateCommand
Dim s As String
s =
""
Dim objDDL As DropDownList
objDDL =
CType(e.Item.FindControl("DropDownListSite"), DropDownList)
s = objDDL.SelectedValue
Dim objRComb As RadComboBox
objRComb = e.Item.FindControl(
"RadComboBoxAdjustedCC")
s = objRComb.SelectedValue
End Sub