找回密码
 立即注册

QQ登录

只需一步,快速开始

[已处理] 行的选择

wedy.wang
初级会员   /  发表于:2012-10-24 09:07:00
沙发
>点击第1行或者第2行,第1行和第2行同时被选择,可以实现吗
请处理GcMultiRow.CellClick事件,并在事件处理函数里面写下面的代码:

  1.         private void gcMultiRow1_CellClick(object sender, GrapeCity.Win.MultiRow.CellEventArgs e)
  2.         {
  3.             Cell cell = this.gcMultiRow1[e.RowIndex, e.CellIndex];
  4.             if (cell is RowHeaderCell)
  5.             {
  6.                 //遍历所有Row
  7.                 for (int i = 0; i < this.gcMultiRow1.RowCount; i++)
  8.                 {
  9.                     //如果项目3的值跟点击的Row的项目3的值相等,就做选择。
  10.                     if (object.Equals(this.gcMultiRow1.GetValue(i, 3), this.gcMultiRow1.GetValue(e.RowIndex, 3)))
  11.                     {
  12.                         this.gcMultiRow1.AddSelection(i);
  13.                     }
  14.                 }
  15.             }
  16.         }
复制代码
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部