DenyWrite to all?

DenyWrite to all?

Old forum URL: forums.lhotka.net/forums/t/1376.aspx


ajj3085 posted on Tuesday, October 03, 2006

Hi all,

I have a grid which lists the objects in a businesslistbase.  All the objects implement an interface. 

There are some properties which the interface define as get and set, but certain types should not allow the value to be changed. 

I thought about using CanWriteProperty for this, but there doesn't seem to be a way to always deny despite the role. 

Any ideas how best to handle this?

Thanks
Andy


xal replied on Tuesday, October 03, 2006

Hi Andy!
You could just override CanWriteProperty and always return false for that property.
Or you could just have an empty set for that property or throw an exception. Of course, if you use can writeproperty to enable/disable controls, you'll need the first one too.

Andrés

ajj3085 replied on Tuesday, October 03, 2006

Wow, how did I miss that one?  Guess I need more caffeine.

I'll override CanWriteProperty.

I don't want an empty setter, because the grid would still allow typing and the value just 'vanishes.'  Not a great UI experience.  CanWriteProperty can thrown an exception,but I'm not sure how the grid will react to that.  Hopefully it will disabled editing in that cell..

Thanks for the quick answer!
Andy

Copyright (c) Marimer LLC