使用内联编辑时 Telerik 网格列会更改大小

发布于 2024-12-22 19:38:48 字数 1050 浏览 3 评论 0原文

我有一个使用内联编辑的 Telerik 网格。

我发现它做的事情非常烦人,当我开始编辑一行时,某些列调整大小,删除按钮消失,并且“取消”按钮出现在编辑按钮列中的编辑按钮旁边。

它看起来像这样:

在此处输入图像描述

这就是创建网格的方式:

<%
Html.Telerik().Grid<myapp.Date>("dates")
    .Name("MyGrid")
    .Pageable()
    .Sortable()
    .Filterable()
    .Groupable()
    .DataKeys(keys => keys.Add(c => c.id))
    .DataBinding(dataBinding =>
    {
        dataBinding.Ajax()
        .Select("_SelectAjaxEditing", "Dates")
        .Insert("_InsertAjaxEditing", "Dates")
        .Update("_SaveAjaxEditing", "Dates")
        .Delete("_DeleteAjaxEditing", "Dates");
    })
    .ToolBar(commands => commands.Insert())
    .Columns(columns =>
    {
        columns.Bound(o => o.name);
        columns.Bound(o => o.date1);
        columns.Command(commands => commands.Edit());
        columns.Command(commands=> commands.Delete());
    })
    .Editable(editing => editing.Mode(GridEditMode.InLine))
    .Render();
%>

I have a telerik grid which uses inline editing.

Something I found it does which is quite annoying is when I start editing a row some of the columns resizes, the delete button dissapears and a 'cancel' button appears next to the edit button in the edit buttons column.

This is what it looks like:

enter image description here

This is how the grid is being created:

<%
Html.Telerik().Grid<myapp.Date>("dates")
    .Name("MyGrid")
    .Pageable()
    .Sortable()
    .Filterable()
    .Groupable()
    .DataKeys(keys => keys.Add(c => c.id))
    .DataBinding(dataBinding =>
    {
        dataBinding.Ajax()
        .Select("_SelectAjaxEditing", "Dates")
        .Insert("_InsertAjaxEditing", "Dates")
        .Update("_SaveAjaxEditing", "Dates")
        .Delete("_DeleteAjaxEditing", "Dates");
    })
    .ToolBar(commands => commands.Insert())
    .Columns(columns =>
    {
        columns.Bound(o => o.name);
        columns.Bound(o => o.date1);
        columns.Command(commands => commands.Edit());
        columns.Command(commands=> commands.Delete());
    })
    .Editable(editing => editing.Mode(GridEditMode.InLine))
    .Render();
%>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛时过境迁 2024-12-29 19:38:48

这是 Telerik Grid 的正常行为方式。

如果不需要,您可以隐藏这些列。

或者您可以尝试使用 InCell 编辑模式。

It is the normal way how Telerik Grid behaves.

You can make those columns hidden, if don't need them.

Or may be you can try to use InCell edit mode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文