context menu affect another grid

3 posts, 0 answers
  1. Moustafa
    Moustafa avatar
    70 posts
    Member since:
    Jul 2008

    Posted 22 Dec 2008 Link to this post

    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. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 23 Dec 2008 Link to this post

    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.
  3. Moustafa
    Moustafa avatar
    70 posts
    Member since:
    Jul 2008

    Posted 23 Dec 2008 Link to this post

    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
Back to Top