XAML Code
<ComboBox Height="23" Margin="69,105,111,0" Name="comboBox1" VerticalAlignment="Top" ItemsSource="{Binding StoreTypeTable}" DisplayMemberPath="StoreTypeName" SelectedValuePath="StoreTypeName" IsSynchronizedWithCurrentItem="True" SelectedIndex="0"/>
C# Code:
My Class:
class StoreTypes:nuClass
{
private WSOntsu.ServiceSoapClient _WS;
private WSOntsu.OSM007StoreType _DS;
public StoreTypes()
{
try
{
_WS = new WpfOntsu.WSOntsu.ServiceSoapClient();
_DS = _WS.lstStoreType();
}
catch (Exception e)
{
bResult = false;
sResult = e.Message;
}
bResult = _DS.Osm007getStoreType.Rows.Count > 0;
}
public DataTable StoreTypeTable
{
get { return _DS.Osm007getStoreType; }
}
}
My Page load:
StoreTypes _ST = new StoreTypes();
comboBox1.ItemsSource = _ST.StoreTypeTable.Rows;
How to display combo initial value when page is loading?
plz help me.