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

context menu affect another grid

2 Answers 28 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Moustafa
Top achievements
Rank 1
Moustafa asked on 22 Dec 2008, 11:25 AM
hi team

I have the following scenario

  1. User control that contians a rad grid with context menu (say uc1)
  2. User control that contains two web part zones.
  3. Each zone contains an instance of the (uc1) control (say uc11,uc12)

the problem is that

when I choose an item from the context menu of the grid in uc11 then the effect appears in the second instance (uc12)

is there any help for the problem.?

Remark:

  • we are using rad controls for asp.net ajax 2008 Q3.
  • IE 7 and Firefox
  • windows vista as operating system

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Dec 2008, 10:10 AM
Hi Moustafa,

Most probably you have a javascript function in your user control say some client-side event handler. In such case when you add the control twice both client-side events will be served by the last javascript function (because it will override the one from the first control). If this is the case you should make sure that the name of the javascript routine is unique by appending some unique identifier - e.g. the ClientID property of the user control. Here is some example:

UserControl1.ascx:

function MyFunction_<%= ClientID%>()
{
}

UserControl1.ascx codebehind:

MyControl1.OnClientEvent = "MyFunction_" + ClientID;

Regards,


Author nickname
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Moustafa
Top achievements
Rank 1
answered on 23 Dec 2008, 11:51 AM
Hi dear

thanks very much for your fast and interesting solution
yes the senario as exactly as  you desribed
so I will do my best to overcome the problem using the supported solution

have nice day
Tags
Menu
Asked by
Moustafa
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Moustafa
Top achievements
Rank 1
Share this question
or