Telerik RadGrid 在按“enter”键时打开一个额外的弹出编辑表单 从用于插入的弹出表单

发布于 2024-07-15 23:33:00 字数 337 浏览 4 评论 0原文

我有一个 radgrid,它使用带有自定义编辑模板的弹出编辑模式。 按下回车键后,编辑表单将在网格中插入一个新项目。 我进去添加一个项目。 这样就插入成功了。 然后我去添加第二个项目:出现弹出表单。 我输入数据并按“回车”键插入项目。 这次,我的编辑表单将清除我输入的数据,并打开另一个弹出编辑表单以允许编辑我之前插入的项目(从第一次开始),而不是插入该项目。 我现在有 2 个弹出窗口(1 个用于插入,1 个用于更新)。

如果我单击插入按钮而不是按“输入”,那么一切正常。 据我猜测,它认为我正在网格上选定的行上按 Enter 键。 当我尝试插入时如何防止它触发“编辑”事件?

谢谢

I have a radgrid that uses the popup edit mode with a custom edit template. The edit form upon pressing the enter key will insert a new item into the grid. I go in and add an item. This successfully inserts. Then I go to add a second item: The popup form appears. I enter in my data and press the "enter" key to insert the item. This time, instead of inserting the item, my edit form will clear out the data I entered and open another popup edit form to allow editing of my previously inserted item (from the first time). I now have 2 popups (1 for inserting, 1 for updating).

If I click the insert button instead of pressing "enter", then everything works ok. From what I can guess is that it is thinking that I'm pressing the enter on a selected row on the grid. How do I prevent it from triggering the "edit" event while I'm trying to insert?

Thanks

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

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

发布评论

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

评论(1

倾城月光淡如水﹏ 2024-07-22 23:33:00

尝试将面板添加到编辑模板并将 DefaultButton 设置为“插入”按钮。

<asp:Panel ID="pnlEditor" runat="server" DefaultButton="btnUpdateItem">

Try adding a panel to the edit template and set the DefaultButton to your Insert button.

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