Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
Displaypath binding problem of XamComboEditor in XamGrid
posted

Try to use Add a template column in following way:

<ig:TemplateColumn Key="Organization" >
 <ig:TemplateColumn.HeaderTemplate>
    <DataTemplate>
      <TextBlock Text="MyColumn" />
    </DataTemplate>
 </ig:TemplateColumn.HeaderTemplate>
 <ig:TemplateColumn.ItemTemplate>
   <DataTemplate>
    <TextBlock x:Name="DisplayName" Text="{Binding Organization.ID,Converter={StaticResource IDToNameConverter}}" />
  </DataTemplate>
 </ig:TemplateColumn.ItemTemplate>
 <ig:TemplateColumn.EditorTemplate>
   <DataTemplate>
      <ig:XamComboEditor                                    
    SelectedItem="{Binding Organization, Mode=TwoWay}"                                       
    DisplayMemberPath="{Binding Organization.ID,Converter={StaticResource IDToNameConverter}}"  Width="310"/>
   </DataTemplate>
 </ig:TemplateColumn.EditorTemplate>
</ig:TemplateColumn>  

When user doulble click on cell to enter edit mode, got following error:

   at MS.Internal.XcpImports.GetClassFullName(String coreClassName)
   at System.Windows.DependencyProperty.LookupAttachedCoreProperty(String propertyName)
   at System.Windows.PropertyPathParser.GetDpFromName(String name, Boolean namespaceMappingAvailable)
   at System.Windows.PropertyPathParser.ReadAttachedPropertyStepDescriptor(Boolean calledFromParser)
   at System.Windows.PropertyPathParser.ReadStepDescriptor(Boolean calledFromParser)
   at System.Windows.PropertyPathParser.Parse()
   at System.Windows.Data.Binding..ctor(String path)
   at Infragistics.Controls.Editors.XamComboEditor.ResolveText(Object dataItem)
   at Infragistics.Controls.Editors.XamComboEditor.InvalidateSelectedContent()
   at Infragistics.Controls.Editors.XamComboEditor.SelectedItems_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at Infragistics.Controls.Editors.XamComboEditor.SelectItem(Object data, Int32 index, Boolean clearRestOfSelection)
   at Infragistics.Controls.Editors.XamComboEditor.ApplyItemSource(IEnumerable itemSource)
   at Infragistics.Controls.Editors.XamComboEditor.XamWebComboEditor_Loaded(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

it is because of binding for DisplayMemberPath in XamComboEditor.

If remove converter, setDisplayMemberPath ="{Binding Name}", no error but only display object like Organization:1234 in dropdow.

If remove binding,set DisplayMemberPath="Name", it is fine.

So want to know if DisplayMemberPath support binding? how to fix it? I want to display more data for DisplayMemberPath, that's why I try converter.

 

 

 

 

Parents Reply Children
No Data