Hi,
I have an xamDatagrid blinded to some binding list. I have added a checkbox column to the grid in FieldLayoutInitialized event like this .
Dim obj As New UnboundField() obj.DataType = GetType([Boolean]) obj.Name = "Select" e.FieldLayout.Fields.Insert(0, obj)
I can make xamdatagrid editable or readonly like this
XamDataGrid1.FieldSettings.AllowEdit=true/false
With this feature I can make whole grid editable or readolnly .But I had a requirement to make paricular columns editable or readonly leaving checkbox column always editable. How this can be achieved.
Advanced thanks for your valuable advise.
Hello,
The AllowEdit property is for the field level. This means that you can either set this for all of the fields (from the FieldSettings object of the XamDataGrid) or you can set this for each field - from the Settings object of a Field. For example, if you want to make all but the first field editable, you can set globally the AllowEdit to false, and then explicitly set AllowEdit to True only on the first field.
Hope this helps.
Hi vince ,
Thanks for your advise
As per your suggestion I had tried to use FieldSettings property of xamdatagrid. But it is the property that holds the default settings for all fields in this control.
"FieldSettings" is not having any property like "Fields" so that I can apply settings to particular field.
I am expecting feature like this but it is not there.
XamDataGrid1.FieldSettings.Fields("column1").AllowEdit=true
I also tried in other way
XamDataGrid1.DefaultFieldLayout.Fields(0)
Like this i can get particular field but field is not having property called AllowEdit. I hope you got my point
As I said in my previous post, you can set this for a field by its Settings object, like this:
xamDataGrid1.FieldLayouts[0].Fields[0].Settings.AllowEdit = false;
The FieldSettings object set properties globally, but they are overriden by the Settings inside each field.
Thanks a lot, It's working.
Why doesn't this work with UnboundFields? I set the FieldSettings for my UnboundField to AllowEdit=False, but the field still shows up as Editable. Using V2009.2.
There is no reason why this should not work for the Unbound Field. One thing that comes up in my mind is that if you are doing this in the xaml and have defined your Field Layouts there (and have left the AutoGenerateFields to true) these settings are not being picked up. If that is not the case, please attach a small sample so that we can look into that.