Player
{
IsNew, Name, LastName, PlayerNumber
}
I have an ObservableCollection<Player> Players in my ViewModel. My grid is binded to this Players collection
I want to make my column that displays my playernumber enabled depending on my IsNew field
I created a multibinding convertor to pass the value IsNew with some other value on my ViewModel that i need.
I'm having problems passing the IsNew property value to my converter. Binding Path="IsNew" does not work. What do I have to do to pass the entire player object to the converter or just the one field from the player that i need?
<igDP:UnboundField Name="LastName" Label="Last Name" BindingPath="LastName" BindingMode="TwoWay" Width="115" > <igDP:Field.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamTextEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="IsEnabled"> <Setter.Value> <MultiBinding Converter="{StaticResource RosterEdit}"> <Binding Path="IsNew" /> <Binding RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type core:GlassWindow}}" Path="DataContext.AllowEdit" /> </MultiBinding> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:UnboundField>
Hello,
I took a look through the whole conversation, but I am not able to determine the reason for this unexpected behavior. As you mentioned some posts ago, you are using the combo editor outside xamDataGrid, but now you are saying that I should refer to your first post which is about editors that take place in xamDataGrid.
Would you please provide me with a sample project in order for me to investigate further, because the sample code that I have provided is working when tested on my computer but when you implement it within your data source, it is not.
I will be looking forward to hearing from you.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
If you look at my original post posted on 04-27-2012 5:40 PM which is the first thread on this that is exactly what i did. I have in my ViewModel a property called players. Please see my earlier comments for further explanation of my scenario, i included everything and also my segment of code. Any help appreciated.
Thank you for your answer.
As you mentioned earlier what is being displayed is the ObjectType. That behavior is being observed when you are passing the control an object and you haven’t gave explicit path to a property that returns some sort of value to be displayed. Than the object’s ToString method is being automatically invoked and what you will get is the string representation of the object’s type.
So in order to have the binding working as expected you have to bind the xamComboEditor to a collection of objects. These objects must expose some sort of properties and you should explicitly point the path to one of them so it will be the DisplayedValue of your xamComboEditor. Binding the TextBlock’s Text value in your ControlTemplate, you can give a Path that points to other properties that are part of the data source objects.
If you have above mentioned implementations and your code is still not working, you can give me a sample project that demonstrates the issue, so I can continue investigating.
Also after trying your code above it did not work. passing the name of my properties are not being recognized. I'm guessing it has to do with the fact that my player is binded to the combo box and the textboxt needs to be passed some form of relative ancestor like the issue i was having earlier. Would you know what it is that i must pass to have my variables work? This would probably also solve the stringformatting issue. It's probably currently not being able to define the properties inside of the parent control's selecteditem.
so there is no way to do this with the stringformat of the textbox? I must use the converter? I've always used stringformats for textboxes and they have worked, Is the problem because the textbox is inside a combobox?