Hi,
I have DataRecords with property, which "knows" if it should be editable for the user or not. Something like:
public class StringProperty
{
public string StringValue { get; set; }
public bool AllowEdit { get; private set; }
}
So I create a Field with Binding to the StringProperty property and a Template to display it and it works so far. But how can I bind the AllowEdit property of each cell (or CellValuePresenter) to the AllowEdit property of the data? (The AllowEdit is set by the business logic according some rules, such as expiration date, etc...).
Thanks in advance,
George
Hello Matt,
thank you for your samples. The last one is an efficient work-arround of what i want, but still wouldn't be enough for me.
I have many custom Editors - like Popups with a rich content. That is why, the user will be irritated if the editor opens and then it is in ReadOnly mode. What I really need is to prevent the user of entering edit mode. And not go in, but not be able to change.
Maybe this could be done with some event handling? I suppose EditModeStarting event would somehow do the job.
But as I asked already in the first post, I am looking for Binding possibility. Is there some? Or should I try it with the event handling?
Sincerely,
HI,
I am attaching a new sample that bindings the IsReadonlyProperty of each editor used by the XamDataGrid to a property in the class that the grid is bound to.
Matt
Developer Support Engineer
Hi Matt,
this works fine. But it uses the IsEnabled Property of the CellValuePresenter. Because of the look and feel, I would like to use the IsEditingAllowed, which is unfortunately a ReadOnly property. Can you tell me, what sets the IsEditingAllowed property? How can I control it?
Best Regards,
HI George,
I am attaching a sample that may help you resovle your issue.