更改 Telerik radgrid 将行标记为“已修改”的方式

发布于 2024-08-10 08:21:07 字数 475 浏览 3 评论 0原文

我正在 Visual Studio 2008 (C#) 中使用 Telerik Winforms Radgrid 版本 2009.2.9.701,我遇到了我似乎找不到解决方案的问题。

当填充 radgrid 并且用户更改行内的单元格时,该行不会被标记为“已修改”,直到用户实际单击数据网格上的另一个位置。如果用户修改一行中的任何值并立即单击我的 winform 上的“保存”按钮,则该行不会被标记为已修改,并且不会显示在我的修改行列表中。

我正在使用以下代码来收集修改的行...

DataTable modifiedRows = dataTable.GetChanges(DataRowState.Modified);

我的问题如下:当用户更改行中任何单元格中的值时,是否有一种方法可以将行标记为“已修改”,而无需用户在单击“保存”按钮之前单击该行。我似乎找不到将数据行标记为“已修改”的标志。

感谢您的帮助,非常感谢。

I am working with the Telerik Winforms Radgrid version 2009.2.9.701 in visual studio 2008 (C#) and I've come across and issue I can't seem to find a solution for.

When the radgrid is populated and the user changes a cell within a row, the row is not flagged as "modified" until the user actually clicks onto another location on the datagrid. If the user modifies any values in a row and immediately clicks the "Save" button on my winform, the row is not flagged as having been modified and is not showing up in my list of modified rows.

I am using the following code to gather the modified rows ...

DataTable modifiedRows = dataTable.GetChanges(DataRowState.Modified);

My question is as follows: Is there a way to mark a row as "Modified" when the user changes a value in ANY cell in the row, without the user having to click off of the row before clicking the save button. I can't seem to find the flag that marks a data row as "Modified".

Thank you for your help, it is much appreciated.

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

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

发布评论

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

评论(1

审判长 2024-08-17 08:21:07

这可能需要解决一些问题,但是您可以让“保存”按钮在单击时将焦点移离网格吗?这可能会导致网格行被标记为已修改。

    private void SaveButton_Click(object sender, EventArgs e)
    {
         SaveButton.Focus();
         // Do work to save the grid's modified rows
    }

This might be a bit of a work around but can you make the Save button move the focus off the grid when clicked? This may cause the grid row to be marked Modified.

    private void SaveButton_Click(object sender, EventArgs e)
    {
         SaveButton.Focus();
         // Do work to save the grid's modified rows
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文