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

CommandItemTemplate does not show

3 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sneha
Top achievements
Rank 1
Sneha asked on 23 Jul 2010, 08:29 PM
I have a rad toolbar inside commanditemtemplate, it wont show, am I missing on some property? 
Its with any control I place in there.

On the client side on which event can I access the commanditemtemplate?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Jul 2010, 09:54 PM
Hello Sneha,

You have to enable the CommandItem:
<MasterTableView CommandItemDisplay="Top" />

As to the second question: you could find the desired controls using the utility methods from our static client library (findElement and findControl):
Telerik static client library

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sneha
Top achievements
Rank 1
answered on 24 Jul 2010, 06:14 AM
Thanks  Daniel for the quick reply!

This tool bar is going to have buttons like A,B..Z,
on the server side what I did was on Item_created event I ran a for loop to have the Alphabets created, I need some function on which I can do this on the clientside.

0
Daniel
Telerik team
answered on 29 Jul 2010, 12:01 PM
Hello Sneha,

You can access the toolbar in the commanditem template and traverse its buttons this way:
<script type="text/javascript">
    function getButtons()
    {
        var grid = $find('<%= RadGrid1.ClientID %>');
        var radToolBar = $telerik.findControl(grid.get_element(), "RadToolBar1");
        var buttonArray = radToolBar.get_items().toArray();
        for (var currentButton = 0; currentButton < buttonArray.length; currentButton++)
        {
            alert(buttonArray[currentButton].get_text());
        }
    }
</script>

If you want to add new buttons on the client please examine the following link:
Working With Items Using Client-Side Code

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Sneha
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sneha
Top achievements
Rank 1
Share this question
or