-1

Pardon me, as I don't have sample code to paste here.

The page has asp:DropdownList which has the events such as change. The eventhandler is attached using jquery (on the lines of $('#mydropdown').bind('change', function() {}); which in turn makes an ajax call (think of 3 dropdowns where dropdown 3 is dependent on dropdown 2 and dropdown 2 is dependent on dropdown 1).

A change request needs me to use Telerik RadComboBox which doesn't have identical model (such as change event, options attribute etc). I would prefer not to modify the existing code that gets triggered on the change event, which does state management & ajax calls on the client side.

Can someone help me redirect the RadComboBox events (OnSelectedIndexChanged to the dropdown events (change), thereby making sure that the code doesn't have to care if its RadComboBox or a html select- because it is able to receive the notification of change event).

Post comments, if this isn't clear.

shahkalpesh
  • 33,172
  • 3
  • 63
  • 88
  • There is no easy way around telerik controls. Cant you just make your existing function take parameters and call it from both change events? – Biff MaGriff Oct 15 '13 at 18:05
  • @BiffMaGriff: The code that handles the event is a generic one. i.e. a kind of 1 page js file that handles related dropdowns, refreshing it, maintaining state, resetting it, clearing it etc. Unless someone has come across this kind of scenario, I will have to write this code. Thanks for your comments. – shahkalpesh Oct 15 '13 at 18:12
  • Please explain the reason when down-voting. – shahkalpesh Oct 16 '13 at 08:17

2 Answers2

0

you cannot do this.Telerik controls behave in different way.The events of this functions are also different.

The javascript used and the method of telerik are different.

Changing the RadcomboBox OnSelectedIndexChangedto change , the logic would be same except just finding controls

Somnath Kharat
  • 3,570
  • 2
  • 27
  • 51
  • Your answer doesn't add anything new that isn't stated in the question. No, the logic isn't same except finding controls. For e.g. you can do `$(#myhtmldropdown).val()`, which you can't do with telerik radcombobox, to give you an example. – shahkalpesh Oct 16 '13 at 08:20
  • see the second line The javascript used and the method of telerik are different. – Somnath Kharat Oct 16 '13 at 08:36
0

Have you taken a look at the RenderMode property on the control? This allows you to define the mode that it should render to the page in. Classic is the default method that Telerik use for creating the controls, but They have Lightweight and Native modes. At least one of them renders a typical select onto the page.

Demo Page

A word of warning, your existing code might work against these objects, but it could equally introduce a number of bugs - thorough testing is recommended.

Obsidian Phoenix
  • 4,083
  • 1
  • 22
  • 60
  • It seems the requirement is to have it show it ajax (non-native). I didn't know such a property existed. Thanks for the answer. – shahkalpesh Oct 16 '13 at 10:01