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

RadContextMenu attributes adding problem

1 Answer 38 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bilal
Top achievements
Rank 1
Bilal asked on 08 Feb 2014, 01:04 PM
We are using RadContextMenu in our product.
I am using Contextmenu within Repeater, The problem I am facing is, I have tried to add client side events in itemdataboud and itemcreated but nothing works.
I am adding it like:
 contextMenu.Attributes.Add("OnItemClicked","return test1();");

But the test1 has never fired.
Note here that I don't care about sender and args parameters.
Can someone please tell me how to add client side attribute in server side code, although the above statement worked for other radcontrols like RadNumericTextbox.

Any help will be greatly appreciated, I have tried to find solutions for many hours now but nothing help, please.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Feb 2014, 06:13 AM
Hi Bilal,

Please try the following code snippet to achieve your scenario.

C#:
...
RadContextMenu1.OnClientItemClicked = "Click";
...

JavaScript:
<script type="text/javascript">
    function Click() {
        alert("fired");
    }
</script>

Hope this will helps you.
Thanks,
Shinu.
Tags
Menu
Asked by
Bilal
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or