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

Dynamically generate ContextMenu

1 Answer 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yogesh
Top achievements
Rank 1
Yogesh asked on 17 Jul 2012, 08:55 AM
Dear Team,

I have an assignment to check the rad grid cell and if the cell has expected value then assign a context menu to the cell. Can anyone help me with the following:

1) attach the context menu on required cells only
2) Create separate context menu object for every cell which qualify the cell.

C#:
RadContextMenu oRadContextMenu = (RadContextMenu)RadContextMenu;
                    ContextMenuControlTarget oMenuTarget = new ContextMenuControlTarget();
 
GridTableCell gtcPreviousCell = (GridTableCell)e.Item.Cells[(e.Item.Cells.GetCellIndex(radCell)) - 1];
                            if (sColumnName == gtcPreviousCell.Column.UniqueName.ToString())
                            {
                                gtcPreviousCell.ID = sCellValue;
                                oMenuTarget.ControlID = gtcPreviousCell.ID;
                                oRadContextMenu.Targets.Add(oMenuTarget);
                            }

Thanks and Regards,
- Yogesh

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 19 Jul 2012, 01:44 PM
Hello Yogesh,

Please refer to the following thread where I have already replied to your post:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radcontextmenu-with-a-radgridview.aspx

Greetings,
Eyup
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
General Discussions
Asked by
Yogesh
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or