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
645
Multibinding
posted

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>

Parents
  • 4475
    posted

    Hello,

     

    I have been looking into your question and in order to implement the needed functionality you can try using a converter within the multi binding:

     

    <Grid>

            <Grid.Resources>

                <local:conv x:Key="aaa"/>

            </Grid.Resources>

                            <TextBlock.Text>

                                <MultiBinding Converter="{StaticResource aaa}">

                                    <Binding Path="porp1" />

                                    <Binding Path="porp2"/>

                                </MultiBinding>

                            </TextBlock.Text>

     

    Notice that the converter implements the IMultiValueConverter interface:

    public class conv : IMultiValueConverter

        {

            public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)

            {

     

               return "custom value";

              

            }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)

            {

                throw new NotImplementedException();

            }

        }

     

    Please let me know if you need further assistance regarding the discussed matter.

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

     

Reply Children