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

Access CommandItem Toolbar on client side

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ColinBowern
Top achievements
Rank 1
ColinBowern asked on 16 Jun 2009, 07:44 PM
I am looking to create a script to toggle the enable/disable flag of a few toolbar items when they are/aren't selected.  I keep getting null back from get_masterTableView - it looks correct to me though - am I missing something?

function Grid1_OnRowSelected(sender, eventArgs) 
    var MasterTable = sender.get_masterTableView(); 
    var selectedRows = MasterTable.get_selectedItems(); 
 
    var gridToolbar = GetRegisteredServerElement("Grid1Toolbar"); 
 
    if (selectedRows.get_Count() > 0) 
    { 
        gridToolbar.findItemByAttribute("CommandName""Copy").enable(); 
        gridToolbar.findItemByAttribute("CommandName""Move").enable(); 
        gridToolbar.findItemByAttribute("CommandName""ToggleStatus").enable(); 
        // Enable copy/move command items 
         
    } 
    else 
    { 
        gridToolbar.findItemByAttribute("CommandName""Copy").disable(); 
        gridToolbar.findItemByAttribute("CommandName""Move").disable(); 
        gridToolbar.findItemByAttribute("CommandName""ToggleStatus").disable(); 
        // Disable copy/move command items 
    } 

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 18 Jun 2009, 11:38 AM
Hello colinbo,

It really looks correct. Can you post a little more information on how do you initialize your RadGrid, attach your client-side OnRowselected event and find your CommandItem controls.

Greetings,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
ColinBowern
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or