locked
how to assign value to combo RRS feed

  • Question

  • private void purMTaxCalsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                string Active;

                if (purMTaxCalsDataGrid.SelectedItems.Count > 0)
                {
                    PurMTaxCal selectedItem = purMTaxCalsDataGrid.SelectedItem as PurMTaxCal;
      
      // FetchCombo();      //comment
      txttaxcalcd.Text = selectedItem.TaxCode;   //it works
      cmbtaxcd.SelectedItem = selectedItem.Tax1Code;  // not able to assign value to combobox

     public void FetchCombo()
            {
                DS.Clear();
                DataServiceQuery<VwFinMTax> query = DM.VwFinMTaxes;
                query.BeginExecute(s =>
                {
                    DataServiceQuery<VwFinMTax> state = s.AsyncState as DataServiceQuery<VwFinMTax>;
                    foreach (var entity in state.EndExecute(s))
                       DS.Add(entity);                  
                   
                    cmbtaxcd.ItemsSource = DS;
                    cmbtaxcd.DisplayMemberPath = "TaxName";
                    cmbtaxcd.SelectedValuePath = "TaxId";

    Saturday, September 24, 2011 5:33 AM

All replies