ItemCommand fires once

4 posts, 0 answers
  1. shimon
    shimon avatar
    37 posts
    Member since:
    Apr 2007

    Posted 25 Sep 2007 Link to this post

    hello,
    i'm using the Q1 version of radcontrols and prometheus.
    my site uses a radgrid and a dynamic created docks.
    i use EnablePostBackOnRowClick="True" on the grid and its fires
    the ItemCommand and i create the dock, after it created the second time the event doesn't fire.

    can you help with this problem?

    thanks,
    shimon
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 26 Sep 2007 Link to this post

    Hi Shimon,

    At which stage of the page lifecycle you create the dock objects programmatically? Furthermore, do you add the dock objects to the grid rows or outside of the grid instance? Any further details describing your complete configuration schema can help us trace the cause of the issue with the ItemCommand event and resolve it accordingly.

    I will also appreciate if you paste the problematic page source in this forum post for further reference.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. shimon
    shimon avatar
    37 posts
    Member since:
    Apr 2007

    Posted 26 Sep 2007 Link to this post

    Hello Stephen,

    i have the grid in one user control and the dock layout in another user control.
    the itemcommand event fires and i collect the needed info from the grid and bubble event to the page in which i add the dock in this function:    public virtual long AddXApp(int XAppId)
        {
            long Result = long.MinValue;
            if (Session["SessionInfo"] != null)
            {
                if ((Session["SessionInfo"] as SessionInfo).InMine)
                {
                    XApp.XApp Dock = CreateDock(XAppId);
                    Result = Convert.ToInt64(Dock.ID);
                    UpdatePanel2.ContentTemplateContainer.Controls.Add(Dock);
                    CreateSaveStateTriggers(Dock);
                    ScriptManager.RegisterStartupScript(
                        Dock,
                        this.GetType(),
                        "AddDock",
                        string.Format(@"function _addDock() {{" +
                            "Sys.Application.remove_load(_addDock);" +
                            "$find('{1}').dock($find('{0}'));" +
                            "$find('{0}').doPostBack('DockPositionChanged');" +
                            "}};" +
                            "Sys.Application.add_load(_addDock);", Dock.ClientID, ZoneLeft.ClientID),
                        true);
                }
            }
            return Result;
        }

    i found out that the script above after it does the postback the itemcommand stop firing. also when i delete a dock with this script:
    ScriptManager.RegisterStartupScript(
                        UpdatePanel,
                        this.GetType(),
                        "RemoveDock",
                        string.Format("function _removeDock() {{" +
                            "Sys.Application.remove_load(_removeDock);" +
                            "$find('{0}').undock();" +
                            "$get('{1}').appendChild($get('{0}'));" +
                            "$find('{0}').doPostBack('DockPositionChanged');" +
                            "}};" +
                            "Sys.Application.add_load(_removeDock);", ((XApp.XApp)sender).ClientID, UpdatePanel2.ClientID),
                        true);

    its also stops the itemcommand to fire.

    the dock usercontrol is loaded in the oninit of the page and the grid usercontrol loaded in the page_load.

    please check it out and instruct me how to fix it.

    thank you,
    shimon
  4. Petya
    Admin
    Petya avatar
    869 posts

    Posted 27 Sep 2007 Link to this post

    Hello shimon,

    Since your scenario involves complicated server-side code, I would kindly ask you to open a support ticket and send us a running, simplified version of your project that reproduces the issue with RadGrid's ItemCommand so we can run it on our side and investigate the problem to provide the most appropriate solution.

    Regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top