Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Values not being populated
Message
De
19/03/2013 10:01:23
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Default Values not being populated
Divers
Thread ID:
01568779
Message ID:
01568779
Vues:
53
Hi,

C#, WPF application.

I have a XAML form based on mmBusinessWindow.

If I start the form and hit New, my default values get displayed on the form.

If I start the form and run a search process to find data then hit the New button, my default values do not get displayed.

Based on advice from Oak Leaf my search does this after finding data:
this.DataContext = this.CourierAirWayBill.DataSet.Tables[this.CourierAirWayBill.TableName].DefaultView;
in order to show data from a display only view of the data (basically, I am showing data from related tables).

The code I have in the New Button's click method is this:
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            this.IgnoreNavigation = true;
            if (this.grdCourierAirWayBills.Items.Count == 0)
            {
                this.DataContext = this.CourierAirWayBill.EntityList;
                //this.DataContext = this.CourierAirWayBill.DataSet.Tables[this.CourierAirWayBill.TableName].DefaultView;
            }
            this.grdCourierAirWayBills.SelectedItem = this.CourierAirWayBill.Entity;
            this.IgnoreNavigation = false;

        }
I believe the problem is because I'm setting the DataContext to the EntityList, but when I try the commented line of code it doesn't work either.

What should I be binding to?

Shouldn't the default code in the mmButtonNew handle this without me having to override it?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform