I've got a xamdatagrid bound to a custom object. One of the fiels is a bool and as the default...the grid is using the xamcheckeditor as the control. That is all working fine. However, I need to know when the box is checked and unchecked so I can set AllowEdit on some fields depending on true or false. Here is my xaml....I wanted to use the EditModeEnding...and according to the checkeditor I should be able to specifiy that...however...I don't see that as an allowable parameter to set...any advice?
AllowEdit you can be set of the Field's Settings and it will apply for all of the cells in that field. However, if you want to do it on a record level basis, you can also use the EditModeStarting event and cancel it if the CheckBox in that column is checked, like this:
void xamDataGrid1_EditModeStarting(object sender, Infragistics.Windows.DataPresenter.Events.EditModeStartingEventArgs e)
DataRecord record = e.Cell.Record as DataRecord;
if (record != null && (bool)record.Cells["UDFNameDataGridColIsDiscreet"].Value == false)
e.Cancel = true;
Thanks...but do I also need to change the XAML...notice I don't explicitly define the field as using the xamCheckEditor (it is the default editor used because the field is a bool...but that's at run time). As such, in the xaml I can't say "....EditModeStarting="methodname"...it doesn't recognize EditModeStarting.
I was referring to the XamDataGrid's EditModeStarting event. Unless you have retemplated the CellValuePresenter, this event should fire for all the cells when they go into edit mode. Do you have a sample that we can look into?
Never mind my last post.... i needed to specify ".Field.Settings.AllowEdit = false"...thanks for your excellent support on this forum.