|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Classe BindingContext
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (em System.Windows.Forms.dll)
O tipo BindingContext expõe os membros a seguir.
| Nome | Descrição | |
|---|---|---|
![]() | IsReadOnly | Infraestrutura. |
![]() | Item[Object] | |
![]() | Item[Object, String] |
| Nome | Descrição | |
|---|---|---|
![]() | Add | |
![]() | AddCore | Infraestrutura. |
![]() | Clear | |
![]() | ClearCore | Infraestrutura. |
![]() | Contains(Object) | |
![]() | Contains(Object, String) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | MemberwiseClone | |
![]() | OnCollectionChanged | Infraestrutura. |
![]() | Remove | |
![]() | RemoveCore | Infraestrutura. |
![]() | ToString | |
![]() ![]() | UpdateBinding |
| Nome | Descrição | |
|---|---|---|
![]() | CollectionChanged | Infraestrutura. |
| Nome | Descrição | |
|---|---|---|
![]() | AsParallel | |
![]() | AsQueryable | |
![]() | Cast<TResult> | |
![]() | OfType<TResult> |
| Nome | Descrição | |
|---|---|---|
![]() ![]() | ICollection.CopyTo | Infraestrutura. |
![]() ![]() | ICollection.Count | Infraestrutura. |
![]() ![]() | ICollection.IsSynchronized | Infraestrutura. |
![]() ![]() | ICollection.SyncRoot | Infraestrutura. |
![]() ![]() | IEnumerable.GetEnumerator | Infraestrutura. |
Observação |
|---|
comboBox1.DataSource = DataSet1; comboBox1.DisplayMember = "Customers.FirstName"; this.BindingContext[dataSet1, "Customers"].Position = 1;
comboBox1.DataSource = DataSet1.Customers; comboBox1.DisplayMember = "FirstName"; this.BindingContext[dataSet1.Customers].Position = 1;
Observação |
|---|
protected void BindControls() { /* Create two Binding objects for the first two TextBox controls. The data-bound property for both controls is the Text property. The data source is a DataSet (ds). The data member is a navigation path in the form: "TableName.ColumnName". */ text1.DataBindings.Add(new Binding ("Text", ds, "customers.custName")); text2.DataBindings.Add(new Binding ("Text", ds, "customers.custID")); /* Bind the DateTimePicker control by adding a new Binding. The data member of the DateTimePicker is a navigation path: TableName.RelationName.ColumnName string. */ DateTimePicker1.DataBindings.Add(new Binding("Value", ds, "customers.CustToOrders.OrderDate")); /* Add event delegates for the Parse and Format events to a new Binding object, and add the object to the third TextBox control's BindingsCollection. The delegates must be added before adding the Binding to the collection; otherwise, no formatting occurs until the Current object of the BindingManagerBase for the data source changes. */ Binding b = new Binding ("Text", ds, "customers.custToOrders.OrderAmount"); b.Parse+=new ConvertEventHandler(CurrencyStringToDecimal); b.Format+=new ConvertEventHandler(DecimalToCurrencyString); text3.DataBindings.Add(b); // Get the BindingManagerBase for the Customers table. bmCustomers = this.BindingContext [ds, "Customers"]; /* Get the BindingManagerBase for the Orders table using the RelationName. */ bmOrders = this.BindingContext[ds, "customers.CustToOrders"]; /* Bind the fourth TextBox control's Text property to the third control's Text property. */ text4.DataBindings.Add("Text", text3, "Text"); }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Função Server Core sem suporte), Windows Server 2008 R2 (Função Server Core com suporte com o SP1 ou posterior, Itanium sem suporte)
O .NET Framework não oferece suporte a todas as versões de cada plataforma. Para obter uma lista das versões com suporte, consulte .Requisitos de sistema do NET Framework.

