简体   繁体   English

vb.net devexpress datagridview在行中添加值

[英]vb.net devexpress datagridview add values in rows

I have Devexpress Grid control in my form, I would like to add values in rows manually, but when I entered value in cell after press enter, I see nothing in cell. 我的表单中有Devexpress Grid控件,我想手动在行中添加值,但是当我在按Enter键后在单元格中输入值时,在单元格中什么也看不到。

I do not understand why, do we need code for this? 我不明白为什么,我们需要代码吗? I dont think soo. 我不这么认为。 See pic here 在这里看到图片 在此处输入图片说明

The GridControl does not maintain an internal data source and should be bound to a data source. GridControl不维护内部数据源,应绑定到数据源。 If you do not want to provide a data source for the GridControl, you should handle the CustomUnboundColumnData event to supply the value for a cell. 如果不想为GridControl提供数据源,则应处理CustomUnboundColumnData事件以提供单元格的值。 You can also try using the UnboundSource data component . 您也可以尝试使用UnboundSource数据组件

Reference: Add Unbound Data to a Data-Aware Control (XtraGrid, XtraPivotGrid) 参考: 将未绑定的数据添加到数据感知控件(XtraGrid,XtraPivotGrid)

In most cases data-aware DevExpress .NET controls contain bound columns/fields that display data from bound data sources. 在大多数情况下,可识别数据的DevExpress .NET控件包含绑定列/字段 ,这些列/字段显示来自绑定数据源的数据。 In Grid Control and PivotGrid controls, it is possible to add unbound columns/fields that can display arbitrary data. 在网格控件和PivotGrid控件中,可以添加可以显示任意数据的未绑定列/字段 Unbound columns are not bound to any field in a data source. 未绑定的列未绑定到数据源中的任何字段。 You can provide data for these fields by specifying a formula (string expression) used to evaluate values or by handling an event 您可以通过指定用于评估值的公式(字符串表达式)或通过处理事件来为这些字段提供数据

If you want to bind data without the currently existing ready-to-use source, use the UnboundSource component as Brendon already suggested. 如果要在没有当前现有的即用型源的情况下绑定数据,请按照Brendon的建议使用UnboundSource组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM