POpup edit form is not loaded automatically

2 posts, 0 answers
  1. sai
    sai avatar
    7 posts
    Member since:
    Mar 2016

    Posted 02 May Link to this post

    Hi Team,

     

    I'm trying to load Popup edit form automatically in radgrid on button click.

    I'm using below code to launcg popup.

     int index = ViewState["ROWINDEX"] != null ? Convert.ToInt32(ViewState["ROWINDEX"]) : -1;
                 if (index > -1)
                 {
                     //if (((System.Web.UI.WebControls.Button)(sender)).Text == "Next")
                     //{
                         this.gvGrowth.MasterTableView.Items[index].Edit = true;
                         this.gvGrowth.MasterTableView.Rebind();
                    // }
                 }

    But the popup is not launched automatically , when i click on the button.

     

    I'm using Telerik.Web.UI, v.2011.3.1305.40 , please let me know whether this version support this functionality or do we have any work around for this.

    I followed the below link to develop my application and I'm using webuser control.

    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx

    This is very urgent , can some one please help me.

    Regards

    Sai teja

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 04 May Link to this post

    Hi,

    The code you are referring to is used to place the first item in edit mode when the page is opened. It is added for illustration purposes to the demo. Most likely you would not need it in a real world scenario.

    If you would like to edit a record with a button you can use any of the following approaches. There is no need to add custom code in order to place an item in edit mode.

    Option 1 - using GridEditCommandColumn:

    <telerik:GridEditCommandColumn ButtonType="PushButton"></telerik:GridEditCommandColumn>

    Option 2 - using GridButtonColumn:

    <telerik:GridButtonColumn ButtonType="PushButton" Text="Edit" CommandName="Edit"></telerik:GridButtonColumn>

    Option 3 - using GridTemplateColumn:

    <telerik:GridTemplateColumn>
        <ItemTemplate>
            <asp:Button ID="Button1" Text="Edit" runat="server" CommandName="Edit"  />
        </ItemTemplate>
    </telerik:GridTemplateColumn>

     
    Regards,
    Viktor Tachev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top