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

User Control Example - Stopping Auto Loading

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 07 Dec 2012, 03:19 PM
I am working with the Demo example at 
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

I have it working on my system with my data, but if you notice the Demo and my version seem to open the UserControl form of the 2nd record in the dataset.  I can't seem to find where in the code that is being specified and how to turn it off. I would like to use it to also be able to specify in a URL string to open a specified record, but if the string is empty not to auto load the 2nd record, as it is doing now.

THANKS!


1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 12 Dec 2012, 12:36 PM
Hello,

You have to remove the code with yellow background in order to stop opening the edit form of the second row.
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
    if (!this.IsPostBack)
    {
        this.RadGrid1.MasterTableView.Items[1].Edit = true;
        this.RadGrid1.MasterTableView.Rebind();
    }
}


Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or