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

Unable to get a RadContextMenu displayed by RadGrid's row right-click from

3 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Holdorf
Top achievements
Rank 1
Steve Holdorf asked on 10 Dec 2012, 07:50 PM
I am using you demo example of getting a radcontextmenu to display from the right-click of a radgrid's data row when the radgrid and radcontextmenu is used with a content page. The code works fine when in a straight asp page;however, in the content portion of the Master/content design it will not work. Below is the following javascript and markup:
<telerik:RadScriptBlock runat="server" ID="RadCodeBlock1">        
    
<script type="text/javascript">
            
        
function RowContextMenu(sender, eventArgs)            {                
            
var menu = $find("<%=RadMenu1.ClientID %>");                
            
var evt = eventArgs.get_domEvent();                
            
if (evt.target.tagName == "INPUT" || evt.target.tagName =="A")               
            
{                   
                
return;               
            
}               

            
var index = eventArgs.get_itemIndexHierarchical(); 

             
document.getElementById("radGridClickedRowIndex").value =index;sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);               

            
menu.show(evt);                

            
evt.cancelBubble = true;                

            
evt.returnValue = false;               

            
if (evt.stopPropagation)               
            
{                    
                    
evt.stopPropagation();                   
                    
evt.preventDefault();               
             
}            
    
}           

    
function openRadWindow(sender, args) {                
        
window.radopen("PopupDialog.aspx", "EditDialogWindow");            
        
}        

    
</script>    
    
</telerik:RadScriptBlock>
    In the javascript the error occurs at the point where menu.show(evt) is called. The error is: Object doesn't support this property or method.Please provide help if possible.Thanks,Steve Holdorf

3 Answers, 1 is accepted

Sort by
0
Steve Holdorf
Top achievements
Rank 1
answered on 11 Dec 2012, 01:09 PM
One other master/content page problem we need help with:

Also in the content page the following javascript will not work:

var rowID;

function RowClick(sender, eventArgs) {
    var radmenu = document.getElementByID('<%= Page.Master.FindControl("MainContent").FindControl("RadGrid1").Client.ID %>');
    if (radmenu.get_masterTableView().get_selectedItem()[0] != null) {
        rowID = radmenu.get_masterTableView().get_selectedItem()[0].getDataKeyValue("ID");
    }
}

<telerik:RadGrid ...
    <ClientSettings>
        <ClientEvent OnRowClick="RowClick"></ClientEvent>

Here I get the same error as above for the radmenu: The error is: Object doesn't support this property or method.  

Thanks,


Steve Holdorf 
0
Steve Holdorf
Top achievements
Rank 1
answered on 13 Dec 2012, 06:54 PM
I built a test master/content page project and your controls worked correctly. This was recommended by the support ticket my boss put in. I guess this is one we have to figure out ourselfs. Anyway, thanks for your support.

Steve Holdorf
0
Pavlina
Telerik team
answered on 13 Dec 2012, 09:29 PM
Hello,

If any questions related to Telerik controls arise, do not hesitate to contact us again. We will gladly assist you.

Regards,
Pavlina
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.
Tags
Grid
Asked by
Steve Holdorf
Top achievements
Rank 1
Answers by
Steve Holdorf
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or