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

[Solved] Client-side addressing of Toolbar buttons in CommandItem

2 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher H.
Top achievements
Rank 1
Christopher H. asked on 11 May 2009, 05:59 AM
Hello,

I'm trying to add some client-side context sensitivity (button showing/hiding, enabling/disabling) to a RadToolBar which I've nested inside the CommandItemTemplate of a RadGrid, but my attempts to get a handle to the toolbar and its buttons aren't working.
I've gone through the various examples and forum threads, and found similar subjects (which I've tried to adapt) but nothing I've been able to figure out how to make use of for this situation.

What I have:
RadToolBar1, with three Buttons and one separator ("Extract", "Separator 1", "Save", "Delete"), inside of the CommandItemTemplate of RadGrid1.

Does anyone have an example of how to get a client-side reference to the nested toolbar or its buttons?

Thanks,
Christopher

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 May 2009, 06:23 AM
Hello Christopher,

Go through the following code library submission on how to access controls in RadGrid templates on client. In the example, a global registry is used to keep the control ID's and script is emitted for every server control that adds an item to the global registry. Finally, by looping over all the registered elements on the client, the required control is accessed using its ServerId.
Accessing server controls in a grid template on the client

Thanks
Princy.
0
Christopher H.
Top achievements
Rank 1
answered on 12 May 2009, 01:29 PM
Hi Princy,

That seems to get me most of the way but I'm obviously missing some understanding of exactly what I'm getting back from the function.  The returned element certainly has the ClientID of the toolbar, but I can't do anything with it.  Any attempt to use any toolbar client side functions on it fail with a error.
So the return value isn't the same as I get when using a $find to get a toolbar that isn't nested, and I'm afraid I'm too noob to quite grasp if there's something I'm not doing that needs to be done.

Thanks,
Christopher H.
Tags
Grid
Asked by
Christopher H.
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Christopher H.
Top achievements
Rank 1
Share this question
or