Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • molnard
    Participant
    Post count: 2

    Hi Fawzi,

    I sent you a simple project by email, the problem is on this picture
    http://postimg.org/image/4suntlymp/

    xaml:

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>
            </Grid.RowDefinitions>
            <Label Content="WPF Combobox"></Label>
            <Label Grid.Row="0" Grid.Column="1" Content="WPF Combobox"></Label>
            <ComboBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Class1S}" SelectedValuePath="Id" DisplayMemberPath="Text" SelectedValue="{Binding Path=Cathegory1, ValidatesOnExceptions=True }"></ComboBox>
            <xctk:WatermarkComboBox x:Name="ComboBox" Grid.Row="1" Grid.Column="1" SelectedValuePath="Id" ItemsSource="{Binding Class1S}" DisplayMemberPath="Text" SelectedValue="{Binding Path=Cathegory1, ValidatesOnExceptions=True }" />
    
        </Grid>

    window:

            public List<Class1> Class1S
            {
                get { return _class1S; }
                set { _class1S = value; }
            }
    
            private int _cathegory1;
            private List<Class1> _class1S = new List<Class1>();
    
            public int Cathegory1
            {
                get
                {
                    return _cathegory1;
                }
                set
                {
                  
                    _cathegory1 = value;
                }
            }
    
            public MainWindow()
            {
                InitializeComponent();
                DataContext = this;
            }

    class:

        public class Class1
        {
            public string Text { get; set; }
            public int Id { get; set; }
          
        }

    Dave

Viewing 1 post (of 1 total)