User (Old forums)MemberApril 9, 2008 at 11:24 amPost count: 23064
I use a DataGridCollectionView as ItemsSource.
In this ItemsSource, I have 3 string fields. In my datagrid, I have 3 columns.
My datagrid EditTriggers and CellEditorDisplayConditions properties are set both to CellIsCurrent.
The weird behaviour is that I can edit all the cells by clicking on it but if a cell is bound to a null value is the ItemsSource, I’m not able to enter the edit mode.
I can workaround this by removing the null values from my itemsSource and change them to String.Empty values.
Has anybody the same behaviour ?
Imported from legacy forums. Posted by Julien (had 3604 views)Xceed SupportMemberApril 9, 2008 at 4:01 pmPost count: 5658
Have you defined ItemProperties in the DataGridCollectionViewSource? If so, and the fieldss of the objects contained in your data source do not have a specific type (object), then the grid will not be able to determine what editor to use when a null value appears and therefore not allow the cell to be edited.
That said, you can either explicitly set each column’s CellEditor or specify the type of each column through the DataGridItemProperties.
Imported from legacy forums. Posted by Jenny [Xceed] (had 231 views)User (Old forums)MemberApril 10, 2008 at 5:07 amPost count: 23064
The ItemProperties of the DataGridCollectionViewSource seem to have been automatically filled when I created its instance given my BindingList. I’ve checked the DataGridItemProperty one by one and all the data types are correct (all System.String).
I have also manually set the column’s CellEditor and then I can enter the edit mode of the cells. But in this case, the cell editor is different from the default one (I have used a DataTemplate with only an AutoSelectTextBox).
Why are the default cell editors not triggered when null value is set ?
Imported from legacy forums. Posted by Julien (had 523 views)Xceed SupportMemberApril 10, 2008 at 10:14 amPost count: 5658
Have you set the AutoCreateColumns property to false? If so, the default editors are not automatically created resulting in their “on-the-fly” creation when a cell enters edit mode. In this case, null values will not be handled.
If you want to explicitly set a cell editor, you can use the static instances on the CellEditor class.
Imported from legacy forums. Posted by Jenny [Xceed] (had 271 views)User (Old forums)MemberApril 11, 2008 at 3:04 amPost count: 23064
Yes, I had set the AutoCreateColumns property to false.
Now, I set explicitly the cell editor with the static instances and it works perfectly.
Thank you for your support !
Imported from legacy forums. Posted by Julien (had 3937 views)User (Old forums)MemberJuly 31, 2008 at 7:22 pmPost count: 23064
I am trying t do this as well (I am new to Xceed DataGrid) can you give me an example of how to specify a static instance for a cell editor? At the moment I have string and numeric fields.
Imported from legacy forums. Posted by Mark (had 542 views)
- You must be logged in to reply to this topic.