This is a migrated thread and some comments may be shown as answers.

Select allready Selected item event

1 Answer 30 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 21 Apr 2015, 10:58 AM

Hello.

My problem is I need to act clientwise on users "reselecting" an item in my radcombo with keystroke.

I.e:
-----------------------------------------------------------

if user select A > fire a client function.
if user select A again > fire a client function

 ----------------------------------------------------------

I can handle the mouseclick event by adding onclick event to the specific RabcomboboxITem ("A"). It works fine. 

I can handle Keystroke select (first time!), by using onClientIndexChanged. It works fine

I can handle Keystroke REselect, by using OnClientKeypressing. It works fine

Troubles start if user selects other item (away from "A").
Now my OnClientKeypressing  event (which fires BEFORE selectionchange)  only sees "A" pressed and wrongfully fires my client function.

Any clues to a solution are appreciated

 

Regards

 Mark



1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo Valyavicharski
Telerik team
answered on 24 Apr 2015, 08:50 AM
Hi Mark,

To prevent the OnClientSelectedIndexChanged firing, try to handle and cacenl the OnClientSelectedIndexChanging event.

function onClientSelectedIndexChanging(sender, args) {
    if (true) {
        args.set_cancel(true);
    }
}


Regards,
Hristo Valyavicharski
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ComboBox
Asked by
Mark
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or