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

Create RadContextMenu dynamically

1 Answer 104 Views
Menu
This is a migrated thread and some comments may be shown as answers.
johnson lim
Top achievements
Rank 1
johnson lim asked on 05 May 2010, 07:41 PM
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?

1 Answer, 1 is accepted

Sort by
0
Lighthouse Developer
Top achievements
Rank 1
answered on 07 May 2010, 09:43 AM
Maybe you haven't closed a parenthesis higher up? Which one is line 151?
Tags
Menu
Asked by
johnson lim
Top achievements
Rank 1
Answers by
Lighthouse Developer
Top achievements
Rank 1
Share this question
or