comment faire un binding en C# au lieu de XAML
bonjour;
voici ma question, je souhaite creer un graphique depuis une table de ma BDD;
j' ai ma BDD dans mon dossier App_Data, j' ai creer mon fichier ADO.net et mon Domaine service class;
voici mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using appli_silverlight_microsoft.Web;
using System.ServiceModel.DomainServices.Client;
namespace appli_silverlight_microsoft.Views
{
public partial class Graphique : Page
{
PopulationContext context = new PopulationContext();
public Graphique()
{
InitializeComponent();
columnnombre.ItemsSource = context.Populations;
DataGrid.ItemsSource = context.Populations;
context.Load(context.GetPopulationQuery());
columnnombre.IndependentValueBinding =
}
// S'exécute lorsque l'utilisateur navigue vers cette page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
}
} |
je ne sais pas comment lui indiquer qu' il doit prendre telles données dans l' IndependentValueBinding;
Ma dataGrid me retourne bien les valeurs de ma table;
Merci;