How do I set Telerik RadGrid to Edit mode by default? (ASP.NET)

22,799

You can put it into edit mode by calling on the pre-render event for the grid.

Here is some sample C# code to do that.

protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (IsPostBack) return;

    foreach (var item in RadGrid1.MasterTableView.Items)
    {
        var editableItem = item as GridEditableItem;
        if (editableItem == null) continue;

        editableItem.Edit = true;
        PreviewRadGrid.Rebind();
    }       
}

http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html

Share:
22,799
Todd Davis
Author by

Todd Davis

Experienced, front-end focused web developer with 19+ years of experience designing responsive, clean and intuitive websites using modern JavaScript frameworks such as Angular. An expert at creating user interfaces that solve problems and streamline online process workflow, I follow a mantra of “Simplify and Empathize” in order to understand the challenges our customers face and how best to address them while opening new avenues of revenue and service for the company.

Updated on November 26, 2020

Comments

  • Todd Davis
    Todd Davis over 3 years

    I have a checkbox column in a RadGrid that I want the user to be able to check/uncheck it and set the attached property. When the grid renders however, the checkboxes are disabled, because the grid is not in "edit mode". All the examples I'm finding want me to go through a lengthy process of selecting the record, putting it into edit mode, changing the value, saving the value.... yada yada yada...

    I just want the whole grid to be in edit mode (or the column, or whatever works) from the get-go, so the end user can make a one-click change to the data value.

    I know there must be a way to do this, I just can't seem to find it.

    Help?