Hi everyone, is there a way that i can stop cells from switching to edit mode when selected. I just need to grid to present data.
Thanks in advance
Hello,
I have been looking into your requirement and the code you provided, but I am not completely sure how you implement the multiple editing and saving, because in the code you have provided you call custom methods, which you didn't uploaded, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
My code for XAMDatagridExtended file logic:
private void KeyDown_EnableMultipleCellsEditing(KeyEventArgs e) { if (EnableMultipleCellsEditing) { if (e.Key == Key.F2) { if (SelectedItems != null && SelectedItems.Count() > 0) { if ((AllowTwoDimensionalMultipleCellsEditing && IsTwoDimensionalMultipleCellsEditingValid()) || IsSelectedCellsInSameColumn()) { SaveSelectedCellsForMultipleCellsEditing(); } else { e.Handled = true; return; } } } else if (e.Key == Key.Escape) { if (MultipleCellsEditingList != null) { MultipleCellsEditingList.Clear(); } } } }
I have 4 rows of which 3 are editable and need to have multieditby selecting F2 for 3 editable ones but when i select the non editable row also, it gets updated with the other 3 which are editable.
My requirement is the non editable row should not update with the other 3 on multi row selection and edit using F2.
The field "comment" in the code should not be editable with multiselect rows and press f2
Code:
<DataPresenter:Field Name="SendPackListWrapper" Label="Packlist"> <DataPresenter:Field.Settings> <DataPresenter:FieldSettings CellClickAction="SelectCell" LabelClickAction="Nothing" LabelMinWidth="75" LabelWidth="75" CellMinWidth="75" CellWidth="75" EditorStyle="{StaticResource YesNoCombo}" EditorType="{x:Type Editors:XamComboEditor}"/> </DataPresenter:Field.Settings> </DataPresenter:Field> <DataPresenter:Field Name="SendDataFileWrapper" Label="Data file"> <DataPresenter:Field.Settings> <DataPresenter:FieldSettings CellClickAction="SelectCell" LabelClickAction="Nothing" LabelMinWidth="75" LabelWidth="75" CellMinWidth="75" CellWidth="75" EditorStyle="{StaticResource YesNoCombo}" EditorType="{x:Type Editors:XamComboEditor}" /> </DataPresenter:Field.Settings> </DataPresenter:Field> <DataPresenter:Field Name="Comment" Label="E-mail comment"> <DataPresenter:Field.Settings> <DataPresenter:FieldSettings CellClickAction="SelectCell" LabelClickAction="Nothing" LabelMinWidth="200" LabelWidth="200" CellMinWidth="200" CellWidth="200" EditAsType="{x:Type System:String}" > <DataPresenter:FieldSettings.EditorStyle> <Style TargetType="{x:Type BaseEditors:TextEditorDBNull}"> <Setter Property="IsEnabled" Value="{Binding DataItem.SendDataFile, Converter={StaticResource boolReverseConverter}}"/> </Style> </DataPresenter:FieldSettings.EditorStyle> </DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field>
Oops, wrong threat. What an idiot.
As expected that absolutely solved my issue!
Thanks very much. I just wished I'd posted before spending a day on it ;-)