Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<telerik:RadComboBox ItemsSource="{Binding Path=Sectors}" SelectedIndex="{Binding Path=SelectedPath,Mode=TwoWay}" SelectedValue="{Binding Path=SelectedSector,Mode=TwoWay}" IsEnabled="{Binding Path=IsPathEnabled}" Width="120" Height="25" VerticalAlignment="Center" Margin="5,0,2,0" x:Name="cbxPaths">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="DropDownOpened">
                        <commands:EventToCommand Command="{Binding Path=DropDownOpenedCommand}" ></commands:EventToCommand>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
   </telerik:RadComboBox>

How to get selecetedindex value from combobox

private int selectedPath = -1;
public int SelectedPath
        {
            get
            {
                return selectedPath;
            }
            set
            {
                selectedPath = value;
                RaisePropertyChanged("SelectedPath");
            }
        }

if(selectedpath == cbxPaths.SelectedIndex)
{
    //some code Here
}

If i run the program i got null exception value(cbxPaths.SelectedIndex).

Object reference not set to an instance of an object.

Any Idea?
Posted
Updated 11-Jun-15 3:38am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900