databinding

WPF binding ComboBox to enum (with a twist)

Well the problem is that I have this enum, BUT I don't want the combobox to show the values of the enum. This is the enum: public enum Mode { [Description("Display active only")] Active, [Description("Display selected only")] Selected, [Description("Display active and selected")] ActiveAndSelected }...

How can I bind a combobox field of a databound object to a datasource and still allow nulls?

I have a form databound to a customer object, and one of the fields is a nullable int representing a "type". This is displayed as a combobox, and the combobox is bound to the "Types" table. When a customer with a null type is loaded into the form's datasource, the combo box displays no value, but then upon clicking it you must select a...

Implement thread-safe collection for data-binding in .NET

I have a Windows Forms application that displays a form with a DataGridView bound to a custom collection that inherits BindingList. I'm using the BindingSource / DataSource mechanism for data-binding. The form is a monitor that displays status information contained in the collection. Each element of the collection represents status in...

Implement thread-safe collection for data-binding in .NET

I have a Windows Forms application that displays a form with a DataGridView bound to a custom collection that inherits BindingList. I'm using the BindingSource / DataSource mechanism for data-binding. The form is a monitor that displays status information contained in the collection. Each element of the collection represents status in...

Databindings don't seem to refresh

For some reason I'm really struggling with this. I'm new to wpf and I can't seem to find the information I need to understand this simple problem. I am trying to bind a textbox to a string, the output of the programs activity. I created a property for the string, but when the property changes, the textbox does not. I had this problem w...

WPF: adding UIElements to a ListBox whose ItemsPanelTemplate is a canvas?

Hello, I'm working on a ListBox that overrides its' ItemsPanelTemplate to use a Canvas instead of a StackPanel. ListBoxItems have a DataTemplate that uses a converter to define the look and position of each ListBoxItem on the canvas. When I add an item to the collection that the ListBox is bound to, I'd like to be able to add other UI...

NHibernate proxy causing problems with databinding

I have a gridview that is bound to the result from an nhibernate query. If the first item in the list is edited the following exception is thrown: System.Reflection.TargetException: Object does not match target type It appears that the problem is caused by the fact that databinding can't deal with the first item in the list being a sub...

Index out of range error; Here but not There!?!?

I have a winform app that fills a lot of its dropdomn fields fram a maintenance table at runtime. Each Form has a Private void FillMaintFields() I have run into a strange error where setting the column visibility on 1 form works but on another gives me an index out of range error! Here is the abriged method on the offending form --> ...

How to make a Silverlight Custom Control's property data-bindable?

Hello, I have created a custom silverlight control, which consists of two date pickers, and a combobox. I would like to make the combobox data-bindable and I know I need to make use of a DependencyProperty. What I am not sure of is exactly how to build it. Here is the code that I have: #region ItemsSource (DependencyProperty) //...

Bindable LINQ (BLinq) in VB.NET

I cannot get Bindable LINQ to work with VB.NET for the life of me. How do I get the .AsBindable extention to appear? Sample code: Class TestList : Inherits Bindable.Linq.Collection.BindableCollection(Of TestItem) 'Some Helpers and stuff' End Class Class TestItem 'Some Properties' End Class Imagine I magically come up with a coll...

Get databinding object in control

Hello, I want to create an enumcombobox where the popup will show the enumvalues of the controls' binding object. Somehow I cannot get the binding object property at runtime. Databindings wil get me to the binding object. But the property and its type is invisable for me, or I just didn't find it yet... Can anyone help me with this? ...

How do you sort an EntitySet<T>

The MSDN documentation states that an EntitySet implements IBindingList (see 'Binding to EntitySets' at http://msdn.microsoft.com/en-us/library/bb546190.aspx) However, it can be clearly seen that an EntitySet does not implement this interface! So how do I sort? For context, I'm binding this set to a WPF ListView. For wider context o...

WPF binding not notifying of changes

I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and databinding so apologise if I am asking a really dumb question :-)) Firstly, I have a linqToSql entity class Contact with an EntitySet<Booking> property Bookings on it. If I directly bind this Bookings property to a ListView, the application seems to correctly no...

How do I bind an ASP.NET Repeater Control to an IList<String>?

I've never had to do this, but I'm binding a repeater to a generic list of Strings, and I'm not sure of the correct syntax. If I was binding to an IList and myType had a property LayerName I'd use this: <asp:Repeater ID="rptChecks" runat="server"> <ItemTemplate> <input type="checkbox" id="<%#Eval("LayerName") %>"/> ...

Data Binding fails

I have a form with 30 fields of data on it - mostly TextBox controls displaying string data, but there are 3 dropdownlist comboboxes and one textbox used to display a datetime. I'm using a BindingSource to bind these fields to a custom data object derived from BindingList<>. Depending on the content of the data in the data source, some...

Populate ParameterCollection w/ sp_columns (or INFORMATION_SCHEMA.Columns) Results

I'd like to build a ParameterCollection object based on the results of either execute sp_columns MyTableName or SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'MyTableName'. The problem I'm having is assigning the appropriate data type to each Parameter ... I'm unsure of how to gather that information from either of the abo...

Update databindings when a TextBox changes rather than loses focus

I'm learning to develop for compact framework and I've come across an issue that's bugging me. I've bound a couple of textboxes to some properties (firstname & lastname of a person class) and have a menuitem which just does a showmessage of the full name, and it works fairly well except that the properties only get updated once the text...

Data binding on a simple detail form

I created a simple detail edit form earlier, and decided to data bind some controls on it. Of course, I was told they needed to be on a data bound container. My immediate, rather uninformed choice was a FormView. Is this appropriate? What containers could I use here? Wrapping my controls in the ItemTemplate of the FormView of course...

How to refresh a WPF DataGrid?

I have a WPF DataGrid with some data. You can add rows through a separate window. The DataContext is the same, a LINQ-to-SQL object. Binding is also the same, I bind the "ItemsSource" property to a table. In the other window, when the user clicks on "Save", I create a row programatically and add it using "InsertOnSubmit". After that I u...

Enable data binding in shared WPF resources inside a ResourceDictionary

I'm using the M-V-VM pattern in WPF and I have a background brush I'm going to be using rather often and I'd like to move it out in to a shared ResourceDictionary. The only problem is the brush uses a color which it gets via Databinding to its hosted context. Is there anyway I can move the brush out in to a ResourceDictionary and still...