Infragistics UltraGrid 选定的单元格值

发布于 2024-07-29 02:55:13 字数 185 浏览 10 评论 0原文

我正在使用 Infragistics 的 UltraGrid,在选择单元格值时遇到问题。 每当我选择一个单元格值时,它默认显示为 0.000。 我想将其显示为 0 或 1。我已经使用 UltraGrid 设计器进行了更改,但由于某种原因它始终显示 0.0000。 奇怪的是,当集合绑定到 Grid 时,它只包含 0 或 1。尽管列的数据类型是十进制。

I am using UltraGrid from Infragistics and facing a problem when selected a cell value. Whenever I select a cell value it shows as 0.000 as default. I want to show it as 0 or 1. I have already made the changes using the UltraGrid designer but for some reason it always displays 0.0000. The strange thing is that when the collection is bind to the Grid it only contains 0 or 1. Although the datatype for the column is decimal.

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

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

发布评论

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

评论(2

轮廓§ 2024-08-05 02:55:13

我找到了一个解决方案来检索 Infragistics UltraGrid 控件的当前复选框的值:

private void grid_CellChange(object sender, CellEventArgs e)
        {

// retrieve the current checkbox value

this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value = !((bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value);

bool selVal = (bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value;

...
}

I found a solution to retrieve the current checkbox's value of Infragistics UltraGrid control :

private void grid_CellChange(object sender, CellEventArgs e)
        {

// retrieve the current checkbox value

this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value = !((bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value);

bool selVal = (bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value;

...
}
清泪尽 2024-08-05 02:55:13

似乎问题与绑定到列的 Decimal 类型字段有关。 我将该字段更改为 Double,现在工作正常!

Seems like the problem was related to the Decimal type field bound to the column. I changed the field to Double and now it works fine!

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