I'm sure this is a stupid question I can't see how to do this. For example if I wanted to set the AllowEdit FieldSetting to true or false depending on a record value. From a cell you would just use "Record.DataItem", but this is not available from a field.
Thanks Joe. I think you solved my problem.
In a more general sense, how would one bind a record to a field (field/setting/layout) in XAML. This I am asking partly as a learning and understanding thing. I am really stuggling to get my head around XAM, and even more so, Xam Datagrid. It seems incredibly powerful. I can envisage doing so many things with the datagrid I would never have been able to do. But I want to get to that point where i feel familair with it and I can understand it's internal structure. For instance laying out a field and altering it's settings and behaviour based on values within the record itself would seem to be an important and standard feature. So I'm sure there is a way to easily do this binding, but I have not n smart enough to realise it.
Thanks,
Graeme
For anybody who's interested, this is how I solved the field-record relationship issue. Not ideal but does the job!
private void x_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e) { if (e.Record is DataRecord) { DataRecord dr = e.Record as DataRecord; foreach (Cell c in dr.Cells) { c.Field.Tag = dr; } } }
Any better solutions, I would love to know.