DevExpress GridView 帖子编辑器

发布于 2024-11-16 11:31:22 字数 351 浏览 4 评论 0原文

我有一个网格控件,其中包含未绑定的列。 问题是,每次我更改单元格值(我正在使用存储库项)时,我都会立即调用 gridview.PostEditor() 方法,以便它会立即更新每次更改特定单元格时都需要更新的网格数据。请记住,我使用的是 PostEditor() 方法,这样我就不必首先失去对单元格的焦点来更新网格视图。无论如何,调用 PostEditor() 将更新我的网格(效果很好),并且仍然打开存储库项目,确切地说是存储库项目旋转编辑控件,但问题是如果我按数字键,它将丢弃旧的值并用新的替换它。我不希望它有这样的行为。我想要它,如果旧值是 10.00 并且我按“0”键,它将将该值更改为“100.00”而不是返回“0.00”。

请帮忙!

谢谢! :)

I have a grid control with unbound columns in it.
The question is, everytime I change a cell value (I am using a repository item) I immediately call the gridview.PostEditor() method so that it would right away update the grid data which requires to be updated everytime I change a specific cell. Keep in mind that I am using the PostEditor() method so that I dont have to lose the focus on a cell first to update the gridview. Anyway, calling the PostEditor() will update my grid (which works fine) and still have the reposiroty item open, a repositoty item spin edit control to be exact, but the thing is if I hit a numeric key, It will discard the old value and replace it with the new one. I don't want it to behave like this. I want it so if the old value is 10.00 and I press the "0" key it will change the value to a "100.00" not back to "0.00".

Please help!

Thanks! :)

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

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

发布评论

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

评论(1

情释 2024-11-23 11:31:22

不知道我是否理解了这个问题。但我搜索了一些我个人的 devexpress 内容并发现了这个:

private void riSpinEdit_EditValueChanged(object sender, EventArgs e)
        {
            TextEdit edit = grdReceiveGoods.FocusedView.ActiveEditor as TextEdit;
            if (edit != null)
            {
                int len = edit.SelectionLength;
                int start = edit.SelectionStart;
                grdReceiveGoods.FocusedView.PostEditor();
                edit.SelectionLength = len;
                edit.SelectionStart = start;
            }
        }

如果这可以解决您的问题,请告诉我。

I dont know if I understand the question. But I did a search on some of my personal devexpress stuff and found this:

private void riSpinEdit_EditValueChanged(object sender, EventArgs e)
        {
            TextEdit edit = grdReceiveGoods.FocusedView.ActiveEditor as TextEdit;
            if (edit != null)
            {
                int len = edit.SelectionLength;
                int start = edit.SelectionStart;
                grdReceiveGoods.FocusedView.PostEditor();
                edit.SelectionLength = len;
                edit.SelectionStart = start;
            }
        }

Let me know if this solves your problem.

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