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>
Yay thank you this is exactly what i wanted and needed. Question regarding this though....when the dropdown is first populated you can't see that there is a drop down until you hit on it and then the drop down appears. Is there a way to force show border on it so that it's explicit to the user that they can edit that field?
Hello,
I am just checking your progress on the issue.
If you require any further assistance please do not hesitate to ask .
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics
www.infragistics.com/support
I have been looking into your example and I think I better understood your concerns.
There are two XamComboEditors – the first one is a cross platform control and the second one is a WPF specific. The WPF specific combo editor has an ItemTemplate property and you can achieve your goal just as you did with the combo box. The Cross platform control does not expose ItemTemplate, but it uses comboBox as an inner control and you can set
<igEditors:XamComboEditor.ComboBoxStyle>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="ItemTemplate">
In order to set the items template.
The cross platform editor belongs to the xmlns:igEditors="http://infragistics.com/Editors"
namespace and I assume that this is the control that you are using.
In your sample code you are setting the XamComboEditor.Template property. This will set the control’s template, but not the control’s items template. That means that the items in the drop down would not be formatted as they are in the comboBox.
I have attached a sample that illustrates the above mentioned implementations. Please take a look and let me know if it meets your requirements.
I will be looking forward to hearing from you.
Infragistics, Inc.
FYI ... this controls are NOT within a XAMDATAGRID. If you're getting confused by the Grid.Row and Grid.Column that is a grid to line up controls so they are not unorganized on the screen. You can take those two out and the code will still work if that is what's confusing you.
This code works NOT USING INFRAGISTICS:
Using the .Net controls i binded a player collection from my view model to a combo box and customized the display according to different properties within my the player object. How do i accomplish this same behavior with infragistics? I am not using a grid. I just have a combo box in a form
<ComboBox Grid.Column="1" Grid.Row="2" Name="cbFGPlayer" SelectedItem="{Binding FieldGoal.Player, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding PlayerCollection}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding StringFormat=" {0} - {1}, {2} ({3}) "> <Binding Path="PlayerNumber" /> <Binding Path="LastName" /> <Binding Path="FirstName" /> <Binding Path="Position" /> </MultiBinding> </TextBlock.Text> </TextBlock> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox>
I tried this to accomplish the same behavior in infragistics and that did not work
<igEditors:XamComboEditor Grid.Column="1" Grid.Row="2" Name="cbFGPlayer" ItemsSource="{Binding PlayerCollection}" SelectedItem="{Binding FieldGoal.Player,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"> <igEditors:XamComboEditor.Template> <ControlTemplate> <TextBlock> <TextBlock.Text> <MultiBinding StringFormat=" {0} - {1}, {2} ({3}) "> <Binding Path="PlayerNumber"/> <Binding Path="LastName"/> <Binding Path="FirstName"/> <Binding Path="Position"/> </MultiBinding> </TextBlock.Text> </TextBlock> </ControlTemplate> </igEditors:XamComboEditor.Template> </igEditors:XamComboEditor>
<MultiBinding StringFormat=" {0} - {1}, {2} ({3}) ">