Hello, I'm a Japanese. Sorry, I can speak English a little.
How to set combobox to cell of XamDataGrid. I saw exsample and news, Used XML resources. but i didn't find how to bind XamComboEditor from ViewModel's collection.
Now, I'm using ObjectDataProviderto to refer to article, but Iwant to use ViewModel collection. how to use it?
ComboBoxItemsProvider and ObjectDataProviderhttp://forums.infragistics.com/forums/p/9408/36631.aspx
<Window.Resources> <!--XamComboEditor Style--> <ObjectDataProvider x:Key="dataProvider" ObjectType="{x:Type local:VehicleTypes}" MethodName="Create" /> <Style x:Key="XamComboEditorStyle1" TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsProvider"> <Setter.Value> <igEditors:ComboBoxItemsProvider ItemsSource="{Binding Source={StaticResource dataProvider}}" DisplayMemberPath="Summary" ValuePath="TypeId" /> </Setter.Value> </Setter> </Style></Window.Resources>
' ------------------------------------------' ViewModelOption Explicit OnOption Strict On
Imports System.Collections.ObjectModelImports Livet
Public Class VehicleSearchViewModel Inherits ViewModel
#Region "コンストラクタ"
Public Sub New() Me.Options = VehicleOptions.Create() Me.Types = VehicleTypes.Create() End Sub
#End Region
#Region "プロパティ"
#Region "Options変更通知プロパティ" Private _Options As IEnumerable(Of Object)
Public Property Options() As IEnumerable(Of Object) Get Return _Options End Get Set(ByVal value As IEnumerable(Of Object)) _Options = value RaisePropertyChanged("Options") End Set End Property#End Region
#Region "Types変更通知プロパティ" Private _Types As IEnumerable(Of Object)
Public Property Types() As IEnumerable(Of Object) <DebuggerStepThrough()> Get Return _Types End Get Set(ByVal value As IEnumerable(Of Object)) _Types = value RaisePropertyChanged("Types") End Set End Property#End Region
#Region "Vehicles変更通知プロパティ" Private _Vehicles As ObservableCollection(Of Vehicle)
Public Property Vehicles() As ObservableCollection(Of Vehicle) Get Return _Vehicles End Get Set(ByVal value As ObservableCollection(Of Vehicle)) _Vehicles = value RaisePropertyChanged("Vehicles")
Me.ClearCommand.RaiseCanExecuteChanged() Me.DetailCommand.RaiseCanExecuteChanged() End Set End Property#End Region
End Class
Thanks.
Hello,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello Mr.Stoyanov.
I'm glad for the reply from you.
Your cord serves as a reference very much. But It's method base. I want to know how to binding ViewModel's properties.