Create RadContextMenu dynamically

2 posts, 0 answers
  1. johnson lim
    johnson lim avatar
    72 posts
    Member since:
    Feb 2010

    Posted 05 May 2010 Link to this post

    hi, i need to create RadContextMenu dynamically based on user requirement.
    below is my coding:



      Dim cRadMenu As New Telerik.Web.UI.RadContextMenu 
      Dim cRadMenuItem As New Telerik.Web.UI.RadMenuItem 
    Dim imgParameter As New Image 
    Dim cRadMenuItem2 As New Telerik.Web.UI.RadMenuItem 
     
       cRadMenu.ID = "adasd" & gvDynamic.Rows(i).Cells(iCellIndex).ID 
                                cRadMenu.Items.Add(cRadMenuItem) 
                                cRadMenu.Items.Add(cRadMenuItem2) 
     
     
     imgParameter.Attributes.Add("onclick", "showMenu(event," + cRadMenu.ClientID + ");") 
    cHtmlTable.Rows(1).Cells(1).Controls.Add(imgParameter) 
    gvDynamic.Rows(i).Cells(iCellIndex).Controls.Add(cHtmlTable) 
     
    but it fail to by giving me error when the page just load:
    The error is  Line :151
                        Char :43
                        Error : Expected ')'
                        Code:0




    Does anyone has idea on this ? Can provide me the sample coding  on how to create this dynamically?

  2. Lighthouse Developer
    Lighthouse Developer avatar
    34 posts
    Member since:
    Feb 2010

    Posted 07 May 2010 Link to this post

    Maybe you haven't closed a parenthesis higher up? Which one is line 151?
Back to Top