devexpress的表格中当某条件不满足时某几列只读

从blog.org的我的原博客中迁入

发表时间:2006-9-13 10:49:54

Grid OptionsColumn
2 msg
Times read: 15 [devexpress.public.dotnet.xtragrid] 

Add to your favorite threads (requires login) -- Thread on dev.newswhat.com (beta)


Grid OptionsColumn
Tarun Patel [Sep 1, 09:58]
Msg has 1 replies
 Add Tarun Patel to favorite authors (login)
Hi,

I have a grid with several columns displayed.  The user can enter data into
the grid which is bound to a datasource.  But if certain criteria is met, I
want some of the columns to be readonly.

I know how to set the OptionsColumn properties, but i can't determine the
best possible event to put the code in. Can you please direct me to the
event best suited for this?

Other grids I have used previously, used to have an event like "CanEditCell"
or similar...

Thanks in advance

 

Re: Grid OptionsColumn
Holger Persch [Sep 1, 11:50]
Msg has 0 replies - Go to base msg by Tarun Patel
 Add Holger Persch to favorite authors (login)
Hi,

You can use the ColumnView's "ShowingEditor" event to do this.

private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
{
      if (condition)
      {
            e.Cancel = true;
      }
}

Regards
Holger

 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值