Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Bind Allow Edit to a method with properties
posted

Hi what i would like to do is bind the AllowEdit property of a cell to a method on the bound object called

public bool IsReadOnly(string propertyName)

where propertyName is the Column Name of the Cell

is this possible (perhaps using something like http://msdn.microsoft.com/en-us/library/aa348824.aspx)

and if so could someone help me with some example xaml style to do this (sorry i'm very new to this)

thanks in advance

Gautam

Parents
  • 69686
    posted

    Hello Gautam,

    The cell does not have a suitable property that you can bind to to make it read only. The Field's Settings have but that would make all the cells in that field read only. I am also not sure if this method will be appropriate of achieving this. The easiest and quickest way to achieve this using your approach is to handle the EditModeStarting method and set the e.Cancel to the result of the IsReadOnly method :

    e.Cancel = IsReadOnly(e.Cell.Field.Name);

Reply Children