- 积分
- 33
- 在线时间
- 53 小时
- 主题
- 28
- 注册时间
- 2013-8-31
- 帖子
- 132
- 最后登录
- 2019-10-21
- 帖子
- 132
- 软币
- 3320
- 在线时间
- 53 小时
- 注册时间
- 2013-8-31
|
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
private void CopyTitle()
{
StringBuilder stringBuilder = new StringBuilder();
StringBuilder stringBuilder2 = new StringBuilder();
foreach (GridColumn gridColumn in this.gridView1.Columns)
{
if (gridColumn.Visible)
{
stringBuilder.AppendFormat("{0} ", gridColumn.Caption);
}
}
int[] selectedRows = this.gridView1.GetSelectedRows();
int[] array = selectedRows;
for (int i = 0; i < array.Length; i++)
{
int rowHandle = array[i];
foreach (GridColumn gridColumn in this.gridView1.Columns)
{
if (gridColumn.Visible)
{
stringBuilder2.AppendFormat("{0} ", this.gridView1.GetRowCellDisplayText(rowHandle, gridColumn.FieldName));
}
}
stringBuilder2.AppendLine();
}
Clipboard.SetText(stringBuilder.ToString() + "\r\n" + stringBuilder2.ToString());
}
|
评分
-
查看全部评分
|