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 Brian,
I am very glad that the sample application that I have sent you, helped solving your issue. Please let me know if you need any further assistance in the matter.
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
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.
I am using Windows 7 SP1, 64 bit with MSVS 2010, and version 11.2.20112.2046 of Infragistics
Hello sykobag,
Thank you for providing the data that you are using. I have created a sample application using the XAML and the data that you have posted and I could not manage to reproduce it. I have tested the sample application using both the RTM (11.2.20112.1012) and the latest service release (11.2.20112.2076) and the Add New Record and the Filter record are editable.
Would you please provide me with more detailed information regarding the environment in which you are developing you application (Operating system, Service Release, Integrated development environment and the specific version of our product that you are using)?