databinding

Databind ADO.NET Entity Framework to ListBox

I'm trying to attach a ADO EF object class (Materials) to a ListBox, and have it auto-update when a new material is added to the database. In my current code below, it will show any items that are in the database before the controls datasource is set, but it will not update. I know I'm missing something elementary here. Any help is gre...

DataBinding Oddity - Converter not called on the second pass

I have a context menu that is defined as a resource and bound to the SelectedItem in a DataGrid, using a converter to get the display name of the current item, as in "Edit " or "Edit " It works fine for the first selected item, but doesn't call the converter on the second (I have a break point in it that only gets hit on the first pass)...

Binding GridView to array of strings. Problem with HyperLinkField

I know that you can use exclamation sign to bind array of simple types (like string) to GridView like this <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Array Field" DataField="!" /> </Columns> </asp:GridView> But this doesn't seem to be the case with ...

Silverlight - Add Ellipses to a canvas dynamically with MVVM

I want to add a dynamic number of ellipses to a canvas and set the ellipse position (canvas.top, canvas.left). I tried binding to an ItemsControl but it each item (ellipse) has a container, so I cant set the ellipses position directly. I don't want an items container, I just want a canvas that contains ellipses. Can this be done? ...

DataSet changes not being persisted to database

I have a windows form with a number of data-bound fields relating to a client. Additionally, I have a DataGridView showing orders for the currently displayed client. This is achieved using the design-time Visual Studio controls (e.g. a project DataSet, BindingSources TableAdapters and a TableAdapterManager. When loading the form to edit...

Are there any data-binding solution that works in C++ and GWT and supports structures polymorphism?

I expect it should share a common description, like XmlSchema or IDL and should generate classes for target language. I found Thrift and it's really nice solution, but it doesn't support structures polymorphism. I would like to have collections of base class objects, where I could place instances of subclasses, serialize this and deseri...

Force databinding to initialize

Is there any way that one can force databindings to be initialized on controls right after they are created? My problem is that I've created a own UserControl derived control which must do some time consuming processing before it is shown. More exactly, create thumbnails of video media using the MediaPlayer component of .Net. I'm displa...

Is it possible to bind dynamic properties to WinForms control properties?

I'd like to bind dynamic properties to WinForms control properties. In the following example I bind the IsAlive property of a thread to the Enabled of a button. using System; using System.Windows.Forms; using System.Threading; namespace ThreadTest { public partial class Form1 : Form { Thread thread; public Form1() { ...

How to stop a bindingSouce/ComboBox from changing selection

I have a simple form with list as a data source, a binding source bound to the list, and a combo box bound to the binding source with some fields editing whatever the bindingSource.Current is. What I would like to do is if a bool is set pop up a dialog asking if they want to save changes before they change items. If they say no I want to...

Interface implements a different interface, causing issues binding to Combobox

I am learning Fluent NHibernate and this issue arose from that project. I have a base Class and a base Interface: public abstract class Base : IBase { public virtual Guid Id { get; set; } public virtual bool IsValid() { return false; } } public interface IBase { Guid Id { get; set; } bool IsValid(); } ...

WPF List of Groups of Controls Databound to List of Custom Class?

I'm still somewhat new to WPF (only done a few small projects with it). I'm trying to make a repeating group of controls (user can add/remove these groups), databound to a custom class. Example UI: ([UserButton1] [UserButton2]) <--each of these () is a separate group of buttons ([Cheese] [Wine] ) ([Wallace] [Gromit] ...

binding dateGridView column to list

Hello, My project in c# cantains dataGridView and i have a object contain data. public class Data { public List list {get;set;} } the data is init at program start up and the length of list can change. i want to bind the gridView to object that when gridView show each columns in gridview is bound to list in data object like this: if ...

Very Strange Binding issue: Commands & Custom Properties

Here's the top of my usercontrol: <UserControl x:Class="MyApp.Common.Controls.Views.SimpleView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" ...

updating a data source for WPF UI bindings

I have a configuration object that contains values to be populated to the UI. This object is serializable to an XML file so the user can save and load the current state of the GUI on the fly. The object itself is a property I've added to my code-behind for a XAML window. If each of the UI controls in this Window are bound to a propert...

Why has moving GridView code to an ascx given an "Databinding expressions are only supported on objects that have a DataBinding event" exception?

I created a GridView in code with a DataTable as its data source which worked fine. I have now moved the GridView creation into a .ascx file to make it easier to format. For some reason this has started triggering the HttpParseException: Databinding expressions are only supported on objects that have a DataBinding event. Syste...

Pause bindings for entire window?

Is there any way to pause all of the bindings on a window, or pause all bindings in the entire program at runtime? I have a class called Page, it contains a lot of variables that my controls bind to in order to update and be updated by the class. I have a load function that loads an XML file and creates a Page class from it. The problem...

How can I Databind to a Sealed Class?

I'm trying to bind some WPF controls to a sealed class provided to me. Because it is sealed, I cannot inherit from it to create a class that implements INotifyPropertyChanged. So I'm not sure how I should go about doing this. Should I create a wrapper that implements INotifyPropertyChanged? Anyone have any tips on what to do? ...

Dependencies in data binding

I'd like to add a derived property to flex: private var a:int; private var b:int; [Bindable] public function get derived():int { return a+b; } However, derived won't update when I change a or b. Is there a better (faster) way to make derived update than giving a and b setter methods which invalidate it? Edit: added keywor...

binding certain items from listbox to combox itemsource

Hi, I have a list box containing many items and I have a combobox in C# WPF. I would like to bind the itemsource of the combobox to that of the listbox but I want to filter out some of the items (it's an xml datasource, I want to filter by the contents of a certain element of the item element). Example item: <Item> <itemtype>A</it...

ModelState doesnt contains Form values

i have this view model: public class ItemMenuViewModel { public ItemMenu Item { get; set; } public IEnumerable<SelectListItem> Pages { get; set; } } for this view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SIIMVC.Controllers.ItemMenuViewModel>" %> <%@ Import Namespace="SIIMVC.Models.Ex...