Hello,
I have a RadSearchBox and a HiddenField. When user selects an item, my HiddenField gets its value from item's ID. But I would like both client and server side HiddenField's value become empty when text in RadSearchBox does not correspond to the HiddenField's value.
So I tried using RadAjaxManager:
01.
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
UpdatePanelsRenderMode
=
"Inline"
>
02.
<
AjaxSettings
>
03.
<
telerik:AjaxSetting
AjaxControlID
=
"RadSearchBoxIns"
EventName
=
"DataSourceSelect"
>
04.
<
UpdatedControls
>
05.
06.
<
telerik:AjaxUpdatedControl
ControlID
=
"HiddenFieldIns"
/>
07.
<
telerik:AjaxUpdatedControl
ControlID
=
"CustomValidatorRadSearchBoxIns"
/>
08.
</
UpdatedControls
>
09.
10.
</
telerik:AjaxSetting
>
11.
<
telerik:AjaxSetting
AjaxControlID
=
"RadSearchBoxIns"
EventName
=
"Search"
>
12.
<
UpdatedControls
>
13.
<
telerik:AjaxUpdatedControl
ControlID
=
"HiddenFieldIns"
/>
14.
<
telerik:AjaxUpdatedControl
ControlID
=
"CustomValidatorRadSearchBoxIns"
/>
15.
</
UpdatedControls
>
16.
17.
</
telerik:AjaxSetting
>
18.
</
AjaxSettings
>
19.
</
telerik:RadAjaxManager
>
In both server events ( OnSearch and OnDataSourceSelect ) I set HiddenFieldIns value to the right ID or empty, respectively, but HiddenFieldIns remains the last selected value, even if user starts typing something else. In debug mode, I can see OnDataSourceSelect is hit and so, HiddenFieldIns's value is, apparently, set to an empty string. Anyway, DOM structure is not changed and when during validation this HiddenFieldIns's value is read again, it's back to its last selected value.
Could you help me to find a way to obtain the desired result?
Thank you in advance.