Hi there,
i have a small problem. I´m using the xamdatagrid and using the SelectedItemsChanged-Event.
In this event i just want to do something if the SelectedItem is a Field.
so i´m using this code:
if (e.Type == typeof(Field)) {
}
but when i select a field and THEN select a cell, it goes right in the if-pattern but it shouldn´t because it´s a cell and not a field.
can you help me out?
regards
cloud
Hello Cloud,
I have been looking into your last question and there is no property ‘AllowEdit’ for single record. This property can be used for field. If you want to allow or not editing for a particular record, you can handle the ‘EnteringEditMode’ event and check whether the desired record is selected and cancel the event.
Please in future create a new forum thread for each of your questions. This way other visitors of our community can get benefit from this.
i understand it now. it was my fault. i did not select a cell i just started the editmode and so the selected item was my field and not the cell where i wanted to edit.
but now i have another problem. is it possible to set the alloweditproperty for a childrecord (DataRecord)?
Hello,
Thank you for your feedback. I am not sure that I understand your scenario completely. Would you please tell me which version of our assembly files you are using like 12.2.20122.1000 ?
I have been trying to reproduce your scenario described in you last post and it seems that everything goes right. I am attaching that sample application(DataGridComboEditorInField.zip) that I have used for my tests.
If possible please modify my sample in order to meet exactly your scenario or attach you own one.
Looking forward to hearing from you.
i tried like you said. but i have to disapoint you ... the type is stille Field. And i also noticed that if i select a cell, the selectedItems.Cells.Count is 0.
Maybe because i got the xamcomboeditor in the cells to edit them?
Cloud
I have been looking into your question and I can suggest you set the ‘LabelClickAction’ to "SelectField" and ‘CellClickAction’ to "SelectCell" like :
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings LabelClickAction="SelectField" CellClickAction="SelectCell" />
</igDP:XamDataGrid.FieldSettings>
This way you when select a field and after that cell you will have the correct Type : Cell.
If you need any further assistance on this matter, feel free to ask.