如何设置Telerik的radgrid控件默认编辑模式? (ASP.NET) [英] How do I set Telerik RadGrid to Edit mode by default? (ASP.NET)

查看:446
本文介绍了如何设置Telerik的radgrid控件默认编辑模式? (ASP.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我希望用户能够选中/取消选中它,并设置附加属性一radgrid控件复选框列。然而,当电网呈现,复选框被禁用,因为网格是不是在编辑模式。我发现所有的例子要我去通过选择记录,把它进入编辑模式,改变了价值,保存价值的一个漫长的过程....亚达内容十分重要...

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.

,我似乎无法找到它。

帮助?

推荐答案

您可以把它进入编辑模式通过调用$ P $网格P-render事件。

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

下面是一些示例C#code做到这一点。

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

这篇关于如何设置Telerik的radgrid控件默认编辑模式? (ASP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆