Bozhidar

Each button has a specific class, that you can use to get the button and trigger a click. Here's an example on how to achieve this:

$telerik.$(".rlbTransferAllFrom").click();

You can see the classes in the rendered html of the page. Also, here is a list of all the buttons and their individual classes:rlbMoveUp, rlbMoveDown, rlbDelete, rlbTransferFrom, rlbTransferTo, rlbTransferAllFrom, rlbTransferAllTo

Note, that when the button is disabled, the class name changes, for instance rlbTransferAllFrom changes to rlbTransferAllFromDisabled.

Regards,
Bozhidar
the Telerik team

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 their blog feed now

Bozhidar

Try attaching the click event in the OnClientLoad event of the RadListBox. That should solve the issue.

All the best,
Bozhidar
the Telerik team

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 their blog feed now

Bozhidar

Please excuse me for my last reply. It seems that I didn't test the listboxes thoroughly enough. The problem comes from the fact that at the time of the binding, the buttons are disabled. In this state they have different classes than the ones used in the binding expression, so the event isn't attached. When I tested the solution the previous time, I had an item already selected from the server, so the TransferFrom button was enabled, which made it look like the workaround was working.

Here's a list of the modified binding functions, which can be used to bind a click event to every one of the buttons, regardless of their enabled state at the time of binding:

functionpageLoad() {

$telerik.$(".rlbButton[title='To Right']").click(function() {

if($telerik.$(this).hasClass("rlbTransferFrom"))

alert("to right");

});

$telerik.$(".rlbButton[title='To Left']").click(function() {

if($telerik.$(this).hasClass("rlbTransferTo"))

alert("to left");

});

$telerik.$(".rlbButton[title='Move Up']").click(function() {

if($telerik.$(this).hasClass("rlbMoveUp"))

alert("moved up");

});

$telerik.$(".rlbButton[title='Move Down']").click(function() {

if($telerik.$(this).hasClass("rlbMoveDown"))

alert("moved down");

});

$telerik.$(".rlbButton[title='Delete']").click(function() {

if($telerik.$(this).hasClass("rlbDelete"))

alert("deleted");

});

$telerik.$(".rlbButton[title='All to Right']").click(function() {

if($telerik.$(this).hasClass("rlbTransferAllFrom"))

alert("all to right");

});

$telerik.$(".rlbButton[title='All to Left']").click(function() {

if($telerik.$(this).hasClass("rlbTransferAllTo"))

alert("all to left");

});

}

I used the pageLoad event here, but any event in which the listboxes are already rendered will suffice.

All the best,
Bozhidar
the Telerik team

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 their blog feed now

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.