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

POpup edit form is not loaded automatically

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sai
Top achievements
Rank 1
sai asked on 02 May 2016, 02:16 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 04 May 2016, 12:12 PM
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.
Tags
Grid
Asked by
sai
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or