0
I have a WPF that is as follows:
<ComboBox Name="comboBoxRemetente" VerticalContentAlignment="Center" Margin="5" Grid.ColumnSpan="20"
ItemsSource ="{Binding Path=Lista, Mode = TwoWay}"
SelectedValue="{Binding Path=Model, Mode = TwoWay}"
DisplayMemberPath="Remetente"
IsSynchronizedWithCurrentItem="True"
SelectedIndex="0"
>
</ComboBox>
<DataGrid Name="GridLista"
Grid.ColumnSpan="20"
Margin="5"
Grid.RowSpan="11"
Grid.Row="8"
CanUserAddRows="False"
CanUserReorderColumns="True"
AutoGenerateColumns="False"
SelectionUnit="FullRow"
SelectionMode="Extended"
ItemsSource="{Binding Path=Lista}"
SelectedValue="{Binding Path=Model, Mode = TwoWay}"
IsReadOnly="True"
>
So, when I start the screen I load the FATHER list and it fills the fields almost everything correctly. My problem is:
I got this combobox:
<ComboBox Name="comboBoxCartao" Grid.Row="7" Grid.ColumnSpan="8" VerticalContentAlignment="Center" Padding="0" Margin="5" Grid.Column="2"
ItemsSource ="{Binding Path=CartaoBean.Lista, Mode = TwoWay}"
SelectedValue="{Binding Path=Model.Cartao, Mode = TwoWay}"
DisplayMemberPath="ToComboBox"
IsSynchronizedWithCurrentItem="True"
SelectedIndex="0"
>
</ComboBox>
This last combobox carries a list of CHILDREN, I have set this one a son, so I need that when selecting a FATHER, he also select the SON in this combobox, could you help me where I am missing? rs
Hash Method of the Card:
public override bool Equals(object obj)
{
var cart = obj as CartaoPostagemModel;
if (cart == null) return false;
return cart.Cartao == this.Cartao;
}
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hash = 17;
// Suitable nullity checks etc, of course :)
hash = hash * 23 + Id.GetHashCode();
hash = hash * 23 + Cartao.GetHashCode();
hash = hash * 23 + Contrato.GetHashCode();
return hash;
}
}
Can you improve and/or contextualize your question? What you want is to select a standard item for the Card combo when the main item (X) is changed?
– Gilberto Alexandre
I have a combobox that you select the FATHER(sender) within the FATHER has a SON(card), I have another combobox that has a list of SON(card) so my wish is: when I select the FATHER he sees the list of son, and selects also, I was able to explain? rs
– HimorriveL
So you have a combobox with a list of cards and want some to be selected according to the chosen sender right? For example, the combobox has 10 cards, but the patch has only 3 registered. When selecting the patch, you want the 3 selected?
– Gilberto Alexandre
almost that, in the case of this example, the combobox has 10 cards, and need among the 10 registered cards, be selected only 1 card that is registered inside the Sender, now was? rs
– HimorriveL