如何在c#中使用devexpress的datagridview中的特定列进行复制? [英] how to make particular column editable for copy in datagridview of devexpress in c#?
本文介绍了如何在c#中使用devexpress的datagridview中的特定列进行复制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在用户点击数据时只复制一列数据,然后按ctrl + c。但我正在使用devexpress网格视图。添加了以下代码。
I want to copy only One column data when user click on data and press ctrl+c.But i am using devexpress grid view.Following code am added.
Am added like gridViewBatches.Columns["Batch No"].ReadOnly = true; Error 71 Property or indexer 'DevExpress.XtraGrid.Columns.GridColumn.ReadOnly' cannot be assigned to -- it is read only –
推荐答案
学习如何制作GridControl r eadonly,请参阅如何使我的网格列成为只读知识库文章。
private void gridViewBatches_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
{
GridView view = sender as GridView;
if (view.FocusedColumn.FieldName == "Batch No") //Editable true
{
e.Cancel = false;
} else //Other column editble false
{
e.Cancel = true;
}
}
这篇关于如何在c#中使用devexpress的datagridview中的特定列进行复制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文