I have a XamDataGrid (code below) in which I am binding to the ActiveDataItem, which works and updates when items are selected. The issue is that although all fields are editable, and that works correctly, the "Add New Row" row is not editable, and neither are any of the filtering boxes. If I remove the ActiveDataItem binding, then all of these are editable, and work correctly. How can I fix this?
<igDP:XamDataGrid GroupByAreaLocation="None" DataSource="{Binding ChannelCollection}" Theme="{Binding Theme, Source={StaticResource MainVM}}" Margin="5" ScrollingMode="Immediate" ActiveDataItem="{Binding SelectedChannel}" IsSynchronizedWithCurrentItem="True"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AllowAddNew="True" AutoGenerateFields="False" AllowDelete="True" HighlightAlternateRecords="True" SelectionTypeCell="None" SelectionTypeField="None" SelectionTypeRecord="Single" AddNewRecordLocation="OnTop"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowEdit="True" AllowRecordFiltering="True" FilterOperatorDefaultValue="Contains" SortComparisonType="CaseInsensitive" AllowGroupBy="False" AllowHiding="Never" LabelTextAlignment="Center" LabelTextTrimming="CharacterEllipsis" LabelTextWrapping="NoWrap" /> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout IsDefault="True"> <igDP:FieldLayout.SortedFields> <igDP:FieldSortDescription FieldName="Name" /> </igDP:FieldLayout.SortedFields> <igDP:Field DataType="{x:Type sys:String}" Name="Name" Label="Name" Visibility="Visible"></igDP:Field> <igDP:Field DataType="{x:Type sys:String}" Name="Unit" Label="Units" Visibility="Visible" ></igDP:Field> <igDP:Field DataType="{x:Type sys:Double}" Name="RangeMin" Label="Minimum Value" Visibility="Visible" ></igDP:Field> <igDP:Field DataType="{x:Type sys:Double}" Name="RangeMax" Label="Maximum Value" Visibility="Visible" ></igDP:Field> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Edit: after further review, I found that if the list is empty, then the Add New record is editable, but as soon as an item is added, it is no longer editable.
Hello,
Thank you for the provided information. I have tested the sample application that I have attached with my previous reply, under the system specifications that you have described and the add new record and the filtering cells are editable. I am attaching a video of the behavior that I am getting. Please let me know if you can reproduce the behavior that you are describing using my sample application.
Looking forward to hearing from you.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you Krasimir for your extensive help on this matter. Using your example as a guide I was able to find my issue:
My SelectedChannel property was defined as such:
Public Property SelectedChannel As ChannelInfoViewModel Get If _selectedChannel Is Nothing AndAlso Channels.Count > 0 Then _selectedChannel = Channels(0) 'OFFENDING LINE Return _selectedChannel End Get Set(ByVal value As ChannelInfoViewModel) _selectedChannel = value RaisePropertyChanged("SelectedChannel") End Set End Property
End Property
Which was causing an issue with the AddItem row, I'll have to find a better way to insure that the selected channel is not nothing.
Thank you again for your help!
Brian