Hai,
I have a hiddenfield in the item template of a Radcombo. I have to take the value of hiddenfield in the SelectedIndexChanged event of radcombo. I used the following method as per your website refernece for radcombo. This code was working fine. But one day it started not working, showing null reference exception in finding the hiddenfield. I didn't change anything.
{
}
aspx
I have a hiddenfield in the item template of a Radcombo. I have to take the value of hiddenfield in the SelectedIndexChanged event of radcombo. I used the following method as per your website refernece for radcombo. This code was working fine. But one day it started not working, showing null reference exception in finding the hiddenfield. I didn't change anything.
protected
void rcbTruck_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox
combo = (RadComboBox)sender;
RadComboBoxItem item = (RadComboBoxItem)combo.SelectedItem;
hidDailyOrderDetailId2.Value = ((
HiddenField)item.FindControl("hidDailyOrderDetailId1")).Value;
}
aspx
<
asp:HiddenField ID="hidDailyOrderDetailId2" runat="server" />
<
telerik:RadComboBox ID="rcbTruck" runat="server" DropDownWidth="250px" Width="250px"
ShowToggleImage="true" Height="140px" AllowCustomText="True" MarkFirstMatch="False"
HighlightTemplatedItems="True" TabIndex="2" EmptyMessage="--Select--" AutoPostBack="true"
EnableLoadOnDemand="True" Skin="Web20" ToolTip="Please Select truck" MaxHeight="250px"
OnItemsRequested="rcbTruck_ItemsRequested" OnSelectedIndexChanged="rcbTruck_SelectedIndexChanged">
<ItemTemplate>
<input id="hidScheduledStartTime" type="hidden" runat="server" value='<%#DataBinder.Eval(Container.DataItem,"ScheduledTime") %>' />
<asp:Label ID="lblVehicleName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"VehicleName") %>'></asp:Label>
<asp:HiddenField ID="hidDailyOrderDetailId1" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"Daily_Order_Detail_Id") %>' />
</ItemTemplate>
</telerik:RadComboBox>