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

Edit form in modal popup

3 Answers 293 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sergio
Top achievements
Rank 1
Sergio asked on 17 Sep 2012, 05:11 PM
Hi I am trying to create an edit form modal popup mode and that the grid remains disabled and gray.
I have the following code and it works fine, just not the grid is disabled me.
any suggestions?

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebAppNueva._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>




<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  >


    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>
       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">


            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>


        </telerik:RadCodeBlock>


            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />


    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True"
        AutoGenerateEditColumn="True" CellSpacing="0" GridLines="None" 
        ShowStatusBar="true"
        OnNeedDataSource="RadGrid1_NeedDataSource"
        OnUpdateCommand="RadGrid1_UpdateCommand"
        OnInsertCommand="RadGrid1_InsertCommand" 
        OnPreRender="RadGrid1_PreRender"
        OnDeleteCommand="RadGrid1_DeleteCommand" 
        OnItemCreated="RadGrid1_ItemCreated"
        OnEditCommand="RadGrid1_EditCommand" 
        OnItemDataBound="RadGrid1_ItemDataBound"
        >
        
        <MasterTableView EditMode="PopUp" CommandItemDisplay="Top"  DataKeyNames="idPersona">
         <EditFormSettings UserControlName="WebUserControlEditPersona.ascx" 
         EditFormType="WebUserControl">
           </EditFormSettings>
           
        </MasterTableView>
         <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>


    </telerik:RadGrid>
   <asp:PlaceHolder ID="PlaceHolder1" runat="server">
    </asp:PlaceHolder>
</asp:Content>

3 Answers, 1 is accepted

Sort by
0
Najid Hanif
Top achievements
Rank 2
answered on 17 Sep 2012, 07:02 PM
Hi try something like this. I assume it can be used with a UserControl. Works with a normal pop-up.

<EditFormSettings UserControlName="WebUserControlEditPersona.ascx"
EditFormType="WebUserControl" PopUpSettings-Modal="True">
  </EditFormSettings>
0
Sergio
Top achievements
Rank 1
answered on 18 Sep 2012, 01:00 PM
it worked, thank you very much.
Does this behavior differs depending on method of charging?
is different if used NeedDataSource?
0
Shinu
Top achievements
Rank 2
answered on 19 Sep 2012, 04:19 AM
Hi Sergio,

You can use custom user control for the RadGrid populated with NeedDataSource event. Here is the demo which implements the same.
Grid / User Control Edit Form

Thanks,
Shinu.
Tags
Grid
Asked by
Sergio
Top achievements
Rank 1
Answers by
Najid Hanif
Top achievements
Rank 2
Sergio
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or