When try to access newly added value in the combo box it gives this error message!
Object reference not set to an instance of an object
window have one combo box and text box! when click the Add new item button, text box value should be loaded in to the combo box.! This loaded action working fine! but when we try to access the newly added one( for example when click edit button) , above error message displayed.
XAML Code:
<ComboBox x:Name="cmbList" x:FieldModifier="public" HorizontalAlignment="Left" Margin="58,10,0,0" VerticalAlignment="Top" Width="147"
<ComboBoxItem Content="1st Item"/>
<ComboBoxItem Content="2nd Item"/>
<ComboBoxItem Content="3rd Item"/>
</ComboBox>
Button Click function :
cmbList.Items.Add(textbox1.text)
Up to this point it working properly! If I try to re select it gives this error message!
Please anyone correct me!
Thanks in Advance!