3 Answers, 1 is accepted
0
Hello Tauqir,
Currently we do not have such server-side event of the RadDropDownTree control that you can use. However you can use the OnClientClearButtonClicked and the OnClientClearButtonClicking client side events.
Regards,
Kate
Telerik
Currently we do not have such server-side event of the RadDropDownTree control that you can use. However you can use the OnClientClearButtonClicked and the OnClientClearButtonClicking client side events.
Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
John
Top achievements
Rank 1
answered on 27 Nov 2013, 01:29 AM
Do you have any samples of how to implement this and triggering an event on the server side?
I have got something to work. I add a custom event argument like this:
And then check for this on PostBack to fire my event:
But this all seems a little messy.
Is there a better way?
Surely the EntryRemoved event should fire if you press the clear button and entries are removed as a result?
This control seems a little half-baked to me!
I have got something to work. I add a custom event argument like this:
function SectionComboBox_OnClientClearButtonClicked(sender, args) {
__doPostBack('<%= rdtSectionId.UniqueID %>', 'ClearButtonClicked')
}
And then check for this on PostBack to fire my event:
if (Page.IsPostBack && Request.Form["__EVENTTARGET"] == rdtSectionId.UniqueID && Request.Form["__EVENTARGUMENT"] == "ClearButtonClicked")
{
//fire my event
}
But this all seems a little messy.
Is there a better way?
Surely the EntryRemoved event should fire if you press the clear button and entries are removed as a result?
This control seems a little half-baked to me!
0
Shinu
Top achievements
Rank 2
answered on 27 Nov 2013, 06:42 AM
Hi John,
Please have a look into the following code snippet to call the server side RadButton OnClick event from RadDropDownTree OnClientClearButtonClicked event.
ASPX:
JavaScript:
C#:
Thanks,
Shinu.
Please have a look into the following code snippet to call the server side RadButton OnClick event from RadDropDownTree OnClientClearButtonClicked event.
ASPX:
<
telerik:RadDropDownTree
ID
=
"RadDropDownTree1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
DataFieldID
=
"id"
DataFieldParentID
=
"parentid"
DataTextField
=
"text"
OnClientClearButtonClicked
=
"OnClientClearButtonClicked1"
>
<
ButtonSettings
ShowClear
=
"true"
/>
</
telerik:RadDropDownTree
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Click"
OnClick
=
"RadButton1_Click"
>
</
telerik:RadButton
>
JavaScript:
<script type=
"text/javascript"
>
function
OnClientClearButtonClicked1(sender, args) {
var
Button = $find(
"<%=RadButton1.ClientID %>"
);
Button.click();
}
</script>
C#:
protected
void
RadButton1_Click(
object
sender, EventArgs e)
{
Response.Write(
"<script>alert('Fired');</script>"
);
}
Thanks,
Shinu.