databinding

DataBinding in ResourceDictionary

Hi All, I've a ResourceDictionary. In which I've defined all the commands. <ResourceDictionary x:Class="HTCmds" x:ClassModifier="public" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

Custom property editors do not work for request parameters in Spring MVC?

Hello, I'm trying to create a multiaction web controller using Spring annotations. This controller will be responsible for adding and removing user profiles and preparing reference data for the jsp page. @Controller public class ManageProfilesController { @InitBinder public void initBinder(WebDataBinder binder) { binde...

WPF binding to collection and adding new item to collection using MVVM

This is probably a simple question... I have a window with a listbox of employees and a # of textboxes for displaying or entering data. The listbox of employees is bound to an observable collection in my ViewModel, which is read from a database. Right now I have a SelectedEmployee property that the textboxes are bound to, so if a user...

'EditItem' is not allowed for this view - databinding issue

Hi, I am trying to do data binding in WPF on data grid using a cutom list. My custom list class contains a private data list of type List. I can not expose this list however the indexers are exposed for seeting and getting individual items. My custom class looks like this: public abstract class TestElementList<T> : IEnumerable w...

How to implement IEditableCollectionView interface

Can anyone please tell me how to implement IEditableCollectionView interface? I am trying to use a custom list for data binding to a data grid in WPF (C#) and need to implement this interface for editing data. Thanks. ...

WPF data-bound ComboBox only shows first item of ItemsSource list

Hi all, I'm sure I'm doing something stupid but for the life of me I can't think of right now. I have a ComboBox that is data-bound to a list of Layout objects. The list is initially empty but things are added over time. When the list is updated by the model the first time, this update reflects properly in the ComboBox. However, sub...

fastest way to exchange data with SQL Server 2008

I have a native C++ windows client application and a SQLServer 2008 server instance. I need to transfer a whole bunch of data both ways. I'm currently using SOCI (http://soci.sourceforge.net/) with an ODBC backend, but have already identified several performance problems with it and would like to try alternatives. SQL data types used are...

Databinding to object - howto update object/binding?

I got a textbox and use databinding to an object. This works fine, until I try to select a new product: product = new Product(id); textbox.DataBindings.Add("Text", product, "ProductName"); // After user action: product = new Product(newId); // <- the textbox isn't updated Do I have to clear the databinding and set it again after the ...

2 (or more) ComboBoxes dependent on each other

Hi, EDIT: The issue underneath is fixed, GO TO EDIT2 in this post. I have an Organisation entity and a Region entity. An object of type Organisation can have one or more Region objects connected to it, thus I have a foreign key in my Region entity to the Organisation Entity. The Organisation and Region objects are pulled from my databa...

Visual Studio Designer looses / ignores data

I'm writing my own control - a datagridviewcolumn that displays integer values as texts like the comboboxcolumn can but without showing the combobox unless the cell is edited. I'm mostly there but I have problems with the databinding. I managed to get the necessary properties to appear in the designer but every time I set the datasource...

MVVM Binding To Property == Null

I want to show some elements when a property is not null. What is the best way of achieving this? The following is my ViewModel: class ViewModel : ViewModelBase { public Trade Trade { get { return _trade; } set { SetField(ref _trade, value, () => Trade); } } private Trade _trade; } ViewModelBase inherits I...

C# MVVM Calculating Total

I need to calculate a trade value based on the selected price and quantity. How can The following is my ViewModel: class ViewModel : ViewModelBase { public Trade Trade { get { return _trade; } set { SetField(ref _trade, value, () => Trade); } } private Trade _trade; public decimal TradeValue { ...

Error Cannot create an Instance of "ObjectName" in Designer when using <UserControl.Resources>

Hi All, I'm tryihg to bind a combobox item source to a static resource. I'm oversimplfying my example so that it's easy to understand what i'm doing. So I have created a class public class A : ObservableCollection<string> { public A() { IKBDomainContext Context = new IKBDomainContext(); Context.Load(Context.GetIBOpti...

Cross-thread problems with .NET data binding

I have a number of Windows Forms controls which are used to interact with my program objects. Currently they subscribe to an "Updated" event on the object and manually update values when needed. I would like to replace all (or as much as possible) of this boilerplate code using data binding. The problem I'm running into is that the obje...

Bind a WPF data grid to multiple data sources

I have created a data grid in WPF and have 2 lists. I want to bind one column to one list and rest of the columns to another list. Can anyone please tell me how to do this? Thanks ...

Creating DataAdapters for Entity Framework

This relates to the reporting suite we are using, but I believe the pattern is the same for WinForms and other .NET technologies. The reporting suite we are using (XtraReports 10) supports design time preview of the data if the DataAdapter property is set. When using a DataSet datasource, a TableAdapter is generated (by the DataSet), wh...

Is there a simple way to specify a WPF databinding where the path is one "level" up?

This example is a admittedly a little contrived but I am doing something similar. Let's say I have the following simple classes: public class Person { public string Name { get; set; } public List<Alias> Aliases { get; set; } } public class Alias { public string AliasName { get; set; } } And let's say that I have Xaml with...

Silverlight 3 DataBinding with ValueConverter: conditionally use the default value for property

I have a DatePicker for which I want to set the BorderBrush to SolidColorBrush(Colors.Red) if the SelectedDate is null. If a date has been filled in though, I want to just have the default BorderBrush. I still want to be able to style the default BorderBrush in Blend, so I don't want to hardcode the default borderbrush of the DatePicker....

WPF In-Memory Image Display

Im trying to build an Item Template for my list-view and im bound to a list of Entities. The entity I have has a System.Drawing.Image that I'd like to display, but so far I cannot for the life of me figure out how to bind it to the <Image> block. Every example and documentation I can find on the internet pertains to Images accessible vi...

How to set the current row/record in a FormView-Control

Hello, I've used the Formview-Control first time now because i was hoping to benefit from its paging- and FormViewMode capabilities. What is the recommended way of setting the datasource and the current row/record? I have a Gridview on the Page and i want to change the Formview Data after the Grid's SelectedIndexChanged-Event occured, bu...