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

ItemCommand fires once

3 Answers 142 Views
Dock
This is a migrated thread and some comments may be shown as answers.
shimon
Top achievements
Rank 1
shimon asked on 25 Sep 2007, 12:37 PM
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

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 26 Sep 2007, 01:43 PM
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
0
shimon
Top achievements
Rank 1
answered on 26 Sep 2007, 01:59 PM
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
0
Petya
Telerik team
answered on 27 Sep 2007, 02:17 PM
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
Tags
Dock
Asked by
shimon
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
shimon
Top achievements
Rank 1
Petya
Telerik team
Share this question
or