databinding

Vaadin and DataModel. How can i get the value stored by a Property DataModel implementation used by a Label Field ??? Vaadin

Hi, It is just a simple TEST application import br.com.elf.ui.IndexApplication; public class IndexApplication extends Application { public void init() { setMainWindow(getStartUpWindow()); } private Window getStartUpWindow() { Window mainWindow = new Window(); mainWindow.addComponent( ...

Set Value of Setter to Attached Property

I need to be able to set the Value of a setter to an attached property, but am having difficulty coming up with the syntax. This is what my trigger looks like: <DataTrigger Binding="{Binding Path=IsDisabled}" Value="True"> <Setter TargetName="LayoutRoot" Property="Opacity" Value="0.3" /> <Setter TargetName="LayoutRoot" Property=...

How to use attribute value as a discriminator for XML polymorphic type selection?

I am trying to write XML Schema by existing XML format description (i.e. document - free form description of elements multiplicity and types). My final idea is to feed such XSD to code generator and get binding classes. Here is an example I cannot cope with: packet1.xml: <?xml version="1.0" ?> <packet kind="type1"> <field1>value1<...

Binding WPF Canvas Children to an ObservableCollection

In my WPF application I have a Canvas in which I do some drawing. Earlier I handled the drawing in the code behind, but now I've factored everything out to a ViewModel. This gives me some challenges.. I have a few InkPresenter objects holding Strokes. Earier I added them as children to the Canvas in the code behind - like this: // Bu...

Android - How do you bind a ListView to a collection of custom objects?

I've got a class called PhoneContact with 3 properties: Title, Description and PhoneNumber If I have a collection of these, how would I go about binding these to a ListView containing a TextView for each property? ...

How to test binders/property editors used on spring 2.5 controllers

I have an annotated controller with a method that expects a model and a binding result @RequestMapping(method = RequestMethod.POST) public ModelAndView submit(@ModelAttribute(“user”) User user, BindingResult bindingResult) { //do something } How do I test the binding result? If I call the method with a user and a binding result...

How to bind a ComboBoxItem's IsEnabled property to the result of a Command's CanExecute method.

I've a custom SplitButton implementation in which contains a ComboBox with several ComboBoxItems bound to commands. I can bind to the Name, and Text properties of the command just fine but have no way of binding the ComboBoxItem's IsEnabled property to the result of a Command's CanExecute method because it is a method. Is there some synt...

How to get a specific BindingSource from a windows form?

I am working on a maintenance windows forms application with Tabbed Interface. In the form there are 3 binding sources (lets call it BindingSource1, BindingSource2, BindingSource3). I am trying to optimize the code and want to dynamically access the BindingSource something like this: objBindingSource = Ctype(Me.Controls("BindingSource" ...

WPF ComboBox: ComboBoxItem background when using DataBinding

When I configure a ComboBox in XAML, I can configure the ComboBoxItems' background color like so: <ComboBoxItem x:Name="someName" IsSelected="True" Background="#454545"/> But how do I do it if the ComboBoxItems come from DataBinding? ...

Silverlight 3: Bind from a combobox in one datagrid cell to one in another cell

I have a Silverlight datagrid where two of the columns are comboboxes. One of the comboboxes is bound to an unchanging Dictionary and is displaying the list of Keys. For the other combobox, I want to populate it with a hardcoded list of strings based on the Value of the selected item in the first combobox. A little more context - the Va...

Binding results of a sql query to listbox

I am getting stuck on this problem. It seems simple but for some reason im having trouble. Here is what I have of the following: Try cn = New OleDbConnection("Provider=microsoft.Jet.OLEDB.4.0;Data Source=G:\Sean\BMSBonder3_0.mdb;") cn.Open() str = "Select Distinct BonderIdentifier From [Session]" cmd ...

Reuse my wpf Binding factory in other code

I've got user-definable columns for my data grid, which basically boils down to a switch(column_title) { case "foo": binding = new Binding("Model.Fonz"); //etc. } and the binding gets applied to the column. Now I need to dump to csv, with the configured columns. As it may be a different column set that being used in my ui and I def...

WPF DataGridTemplateColumn databind to control outside?

Well i have a control thats placed in a usercontrol and it exposes a ICommand with a DepenceyPropety(ShowCommand), and then i have a datagrid (wpf toolkit) with a few columns and one of them has a delete button <Custom:DataGrid Margin="0" ItemsSource="{Binding Todos}" AutoGenerateColumns="False"> <Custom:DataGrid.Columns> <Cu...

ItemTemplate in Silverlight ListBox being ignored

I have a databound ListBox with an ItemTemplate, following this example: <ListBox ItemsSource="{Binding Path=FlightHeadings}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Identifier}" /> <TextBlock Text="{Binding Path=Name}"/> </StackPanel> </DataTemplate> </L...

ASP.NET three-level databinding

Hi, I have custom objects I am binding to using ObjectDataSource. I have three-level binding: a DropDownList (Department) that filters the next DropDownList (Category) that filters a GridView (Questions). Each ObjectDataSource binds to the previous control's SelectedValue (except the first one, of course). Everything works fine only t...

When to do calculations

Which way is better to store sales information in a database: Store cost for an item and sales price per item Store cost * qty and sales price * qty - so you are storing the totals in the db ...

binding html radio buttons

I have a list of input type radio buttons in formview (edit mode) and i want to bind data from datasource that is assigned to formview. Can i bind html radio buttons using sql datasource? ...

Databinding in WinForms performing async data import

I have a scenario where I have a collection of objects bound to a datagrid in winforms. If a user drags and drops an item on to the grid, I need to add a placeholder row into the grid and kick off a lengthy async import process. I need to communicate the status of the async import process back to the UI, updating the row in the grid and ...

Manipulating ObservableCollection vs Replacing a List

I have a backend Dictionary that is used for synchronization (ie. to both a filestore and a webservice). Off the top of this I need to generate lists/enumerables for the WPF frontend to consume. What is the difference between either hooking an enumerable up to the dictionary, and calling PropertyChanged when it is updated to using an Ob...

Weird problem where Button does not get re-enabled unless the mouse is clicked

My app is written using the MVVM pattern in WPF, and all of my Buttons use Command bindings to execute code in my model. All commands have code in CanExecute to determine the bound Button's Enabled state. The logic works perfectly, but in all cases, the GUI remains in a disabled state unless I click somewhere else in the GUI. For exam...