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

Put Grid in UpdatedControls prevents execute javascript function in order to show popup window

1 Answer 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sina
Top achievements
Rank 1
Sina asked on 08 Sep 2013, 11:02 AM
Hi.I call javascript function in server side in Grid ItemCommand event :

protected void grd_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName != "Update") return;
            ClientScript.RegisterStartupScript(GetType(), "test", " $('#element_to_pop_up').bPopup({ speed: 650, transition: 'slideIn' });", true);
            var item = e.Item as GridDataItem;
            var id = item["colID"].Text;
            txtName.Text = item["col"].Text;
            lblMsg.Visible = false;
            Session["MeasureId"] = id;
        }

When I put my gird into my Button UpdatedControls , my javascript function doesn't work  and my popUp menu doesn't show ....

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txtName" />
                    <telerik:AjaxUpdatedControl ControlID="lblMsg" />
                    <telerik:AjaxUpdatedControl ControlID="grd" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

my PopUp is :

<div id="element_to_pop_up" style="border: thin solid #400000; padding-top: 30px; display: none; font-family: tahoma; font-size: small; width: 400px; float: right; direction: rtl; background-color: white">

        <div style="float: right; padding-right: 10px">
           Unit Name : &nbsp;
        </div>
        <div style="float: right">
            <telerik:RadTextBox ID="txtName" runat="server" Font-Names="tahoma">
            </telerik:RadTextBox>
        </div>
        <div style="width: 100%; float: left;">
            <div style="padding-top: 20px; padding-right: 10px">
                <asp:Label ID="lblMsg" runat="server" Text="Label" ForeColor="Maroon" Visible="False"></asp:Label>
            </div>
            <div style="padding: 20px; float: left">
                <telerik:RadButton ID="btnSave" runat="server" Text="Save" Font-Names="Tahoma" Skin="Office2010Black" Width="100px" Height="30px" ButtonType="LinkButton" OnClick="btnSave_Click"></telerik:RadButton>
            </div>
        </div>
    </div>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 09 Sep 2013, 05:33 AM
Hi Sina,

I guess you are trying to show a popup window.One suggestion would be to use RadWindow object to RadGrid in order to edit/insert data in a popup fashion.Please try the demo on Window - Window Editing.

Thanks,
Shinu
Tags
Grid
Asked by
Sina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or