databinding

WinForms Databinding

I've built some business objects, and I've built a "data access layer" that will read, update, delete, etc. Now I want to bind these objects to grids/text boxes/combo's etc in a WinForm's app. I could do the manual method like: txtName.Text = employee.Name; and then on save do something like employee.Name = txtName.Text; But I'd...

ObservableCollection(Of T) vs BindingList(Of T) ?

Hi, I've developped some data based Winforms Application this last two years and all works fine. This application are built on layers (DataAccess, Business Logic and UI). For the Businness Logic, all my objects inherit from a base class called BaseEntity with the following definition (there are some custom objects and interfaces, combin...

Refreshing a wpf databinding after object has been updated

I have a object in a presenter connected to a view. Inside my XAMTL I have the following: <Label Content="{Binding ElementName=PSV, Path=Presenter.Portfolio.Name}"/> Now when the control is created, Portfolio is null, then i run another method which sets Portfolio. I've implemented INotifyPropertyChanged but so far, I've not been able...

How do you correctly update a databound datagridview from a background thread

I have a custom object that implements INotifyPropertyChanged. I have a collection of these objects where the collection is based on BindingList I have created a binding source for the collection, and set the datasources of the bindingsource and datagridview. Everything works great, except I need to update properties on the custom obje...

How do you use two-way binding if the instance being bound does not implement INotifyPropertyChanged in Silverlight 2?

I am trying to write a fairly simple user control in Silverlight 2 that allows the user to search for existing addresses, optionally update the selected address, and add new addresses. To this end I have put together a simple WCF service that allows for simple querying and I am currently wiring this up to a textbox, listbox combination ...

Why does this simple databinding scenario not work? (ComboBox related)

Hi all, I've been scratching my head on this one for a while now and am stumped at the moment. The problem scenario is easier to explain as code so hopefully it speaks for itself. First of all, I have a silverlight application with the following in the XAML... <UserControl x:Class="SilverlightApplication2.Page" xmlns="http://schemas.m...

UI Databinding: alternatives and future

UI Databinding aka transfer of information/data from the biz-layer/datamodel of an application to the UI and from the UI back to the datamodel, seams to be ignored a little by language and framework designers. Almost all information processed by software systems today has to be presented at some point of the processing chain to human u...

DataBind to specific records

I have a DataGridView binded to this table: [Users] ID Name -- ---- 11 Qwe 22 Asd Grid is direclty binded to typed dataset table. I have a second table like this: [Records] ID UserID Data -- ------ ---- 67 11 .... 68 11 .... Records.UserID is connected to Users with a foreign key. What I want to do is: when the us...

Unit-testing data binding in System.Windows.Forms

I'm facing a problem while unit testing my forms. The problem is that data bindings are simply not working when the form is not visible. Here's some example code: Data = new Data(); EdtText.DataBindings.Add( new Binding("Text", Data, "Text", false, DataSourceUpdateMode.OnPropertyChanged)); and later on: Form2 f = new Form2(); ...

Finding out who is listening for PropertyChangedEventHandler in c#

I have a WPF form and I am working with databinding. I get the events raised from INotifyPropertyChanged, but I want to see how to get a list of what items are listening, which i fire up the connected handler. How can I do this? ...

Determine why Bound Data is not available at PostBack

I've got an ASP.NET GridView that's been extended to provide a "row click" functionality. I data bind anywhere from 1 to 10 records and display it to the user. The bug I'm hitting is that the control will not have any data associated with it on postback. I have observed this behavior only when I click on a row before the rest of the...

Deleting rows in a DataGridView

I am currently using a DataGridView coupled with a subform to implement a master/detail setup. The DataGridView only supports row selection and deletion events - editing/adding items is entirely handled in the subform. As such, I maintain a list of entities that I make changes to, while binding the DataGridView to a list of anonymous ty...

Complex databinding to DataGridView header text

Is there a way to complex databind to a column's header text? Or is the only way to manually set the values and listen for change events from the source? For the record, I've tried both MyDataGrid.DataBindings.Add("Columns[<columnIndex>].HeaderText",MySource,"MyProperty"); and MyDataGrid.DataBindings.Add("Columns[\"ColumnName\"].Hea...

Problems with combining Serialization and DataBinding

Actually i'm working with C# and already got DataBinding and Serialization to work. But now i'd like to combine both methods in one class and i have a little problem with it. So let's start with a little sample class: using System; using System.Runtime.Serialization; using System.Windows.Forms; namespace MySample { [DataContract(I...

Repeater's SeparatorTemplate with Eval

Hi, is it possible to use Eval or similar syntax in the SeparatorTemplate of a Repeater? Id' like to display some info of the last item in the separator template like this: <table> <asp:Repeater> <ItemTemplate> <tr> <td><%# Eval("DepartureDateTime") %></td> <td><%# Eval("ArrivalDa...

c++ xml data binding

There are several comparisons of the different java xml data binding tools online. I'd like to see this become a useful comparison between the different c++ tools for xml data binding. Which tool are you using for xml data binding in c++ ? CodeSynthesis and xmlbeanscxx are a couple of the available choices. I'd like everyone to add...

Why is using an abstract class for DataBinding in WPF different from using an Interface?

As we all know, we can't use DataTemplates with Interfaces, but apparently (old question) we can use abstract classes. Why? The multiple inheritance argument goes for abstract classes as well... ...

"Property 'Path' does not have a value"

I'm using the following xaml to fill the dataContext: DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" The application works fine, but Cider complains that I must set the Path property. I'm interested in the entire object, and not a specific property though. I hope there's a way to get the designer support back...

How does one databind a custom type to TextBox.Text?

I have a custom c# type like (just an example): public class MyVector { public double X {get; set;} public double Y {get; set;} public double Z {get; set;} //... } And I want it to databind to TextBox.Text: TextBox textBox; public MyVector MyVectorProperty { get; set;} //... textBox.DataBindings.Add("Text", this, "MyV...

Binding a DropDownList in ListView InsertItemTemplate throwing an error

I've got a ListView which binds to a LinqDataSource and displays selected locations. The insert item Contains a dropdownlist that pulls from another LinqDataSource to give all the unselected locations. The problem is that I get the following error when loading the page: Databinding methods such as Eval(), XPath(), and Bind() can only ...