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

Client side script access to CommandItem template

5 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mary
Top achievements
Rank 1
mary asked on 16 Jul 2008, 10:16 AM
Is there a way to get access to the commanditem from with the RowSelected() client side event on the grid (using the sender or eventargs params)?

Thanks

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jul 2008, 10:37 AM
Hi,

Go through the following code library submission which explains how to access controls in a Grid template on the Client side.
Accessing server controls in a grid template on the client

Thanks
Shinu.
0
newbie
Top achievements
Rank 1
answered on 06 Aug 2008, 06:01 PM
I want to access a button inside the commanditemtemplate through javascript.

What I need to do is specify that button ID as the OpenerElementID for a radwindow.

How can I do that?
0
Yavor
Telerik team
answered on 07 Aug 2008, 05:47 AM
Hello,

While getting a reference to the button, nested within the can be tricky, depending on the structure of the control, you can try a different approach. From the server, you can get a reference to the CommandItem, and then the button nested in it. You can then assign the clientId to a hidden input on the page.
From the client side, you can easily access the hidden input, and get the clientId of the button. Then, you will be able to easily get the button, via its clientId.
I hope this suggestion helps.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
newbie
Top achievements
Rank 1
answered on 07 Aug 2008, 05:57 PM
I understood the part about putting the value in the hidden control.

How do i specify the openerElementID as the button for the radwindow using the hidden control?
0
Yavor
Telerik team
answered on 08 Aug 2008, 07:30 AM
Hi,

The hidden input will actually contain the id, which can be assigned as the openerElementID for the window. Also, if you do not need to necessarily specify this id on the client, you can get a reference to it on the server, and assign it to the openerElementID directly, as opposed to doing so on the client.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
mary
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
newbie
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or