单击 checkEdit 项目时,网格控件中的 IsSetData 永远不会为 true
我有这个 DevExpress GridContro
l,我添加了两个列,一个包含 repositoryItemCheckEdit
,另一个包含正常的 string
类别描述。
现在,我已将 repositoryItemCheckEdit
设为属性部分中的未绑定布尔值,并添加了 gridView1_CustomUnboundColumnData
事件,该事件以 e.IsGetData
true 触发,但当我单击复选框时,e.IsSetData
永远不会为真。谁能解释这是为什么吗? 谢谢
private void gridView1_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e)
{
if (e.IsGetData)
{
string itemKey = ((CategoryTable)(gridControl1.ViewCollection[0]).GetRow(e.RowHandle)).Category;
if (AddressDoc == itemKey) e.Value = true
else e.Value = false;
}
if (e.IsSetData)
AddressDoc = ((CategoryTable)(gridControl1.ViewCollection[0]).GetRow(e.RowHandle)).Category;
}
I have this DevExpress GridContro
l which I've added with two coloums the one containing a repositoryItemCheckEdit
and the other normal string
Category description.
Now I've made the repositoryItemCheckEdit
a unbound bool in the property section and added the gridView1_CustomUnboundColumnData
event which fires with e.IsGetData
true but the the e.IsSetData
is never true when I click on the check box. Can anyone explain why this is?
Thanks
private void gridView1_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e)
{
if (e.IsGetData)
{
string itemKey = ((CategoryTable)(gridControl1.ViewCollection[0]).GetRow(e.RowHandle)).Category;
if (AddressDoc == itemKey) e.Value = true
else e.Value = false;
}
if (e.IsSetData)
AddressDoc = ((CategoryTable)(gridControl1.ViewCollection[0]).GetRow(e.RowHandle)).Category;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试如何保存 in- 的值中的解决方案一旦更改,请立即放置复选框我们网站上发布的知识库文章。它应该可以帮助您解决这个问题。另外,我已经检查了您的代码,它看起来并不安全。我将其更改如下:
我只能认为您没有正确调整未绑定的列。注意:列应满足两个强制条件才能解除绑定:
1)它的FieldName应该设置为其他GridView列的fieldName属性中的唯一值;
2) 列的UnboundType 应设置为非Bound 值。
Please try the solution from the How to save the value of an in-place check box as soon as it is changed knowledge base article published on our web site. It should help you resolve this problem. Also, I have reviewed your code and it does not look to be safe. I would change it as follows:
I can only think that you did not properly adjusted the unbound column. NOTE: a column should meet two mandatory conditions to be unbound:
1) it's FieldName should be set to a unique value among fieldName properties of other GridView columns;
2) the column's UnboundType should be set to the non Bound value.