databinding

Silverlight Control property as a data binding Source and View-Model property as target

I have a property on a Silverlight control that a ViewModel wants to bind to. The ViewModel need to told of changes to the property NOT the other way around Syntax like <MyControl ViewPort="{Binding VMProperty}"/> Declares ViewPort as the Target, in this instance ViewPort is the source of the data. I know I could make it TwoWay bind...

Using ModalPopupExtender within ListView Item with Manual DataSource Binding

I'm using the Ajax Control Toolkit to show a popup box triggered by a button embedded in an ItemTemplate of a ListView. I've wrapped up the entire modal popup in a feature rich usercontrol used many times throughout my website with no problems. The trigger button is part of my usercontrol, and is used as a rename button for each item dis...

Select the current value in a dropdownlist using XSL and SharePoint

I'm using the row edit template below. The problem I have is that the current value is not selected when the row edit XSL template is used. The value defaults to the first item in the list. What is the best way to get the current value to be the selected item in the template below? I thought having DataValueField="{@type}" and DataTe...

Zooming an image using Data Binding in silverlight 3

I am trying to create a simple image viewer which includes a zooming slider. using Data Binding and ScaleTransform, I am trying to "zoom" the image. Here is my xaml: <Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefin...

WPF DataBinding Error: I have no idea how I'm getting this error.

I get the following errors from the code below... not sure why (and yes, it produces all 4 even though it's the same 2 repeated). Oh, and it doesn't produce the alternating rows effect, even though prior to these errors popping up the same code was working. System.Windows.Data Error: 4 : Cannot find source for binding with reference 'Re...

Troubleshooting WPF / Silverlight XAML databinding ?

Whenever I am doing XAML, I tend to run into problems with databinding. It is often small issues, such as misspelling a property name. My problem is, that I don't seem to receive any errors or warnings when I am trying to bind to a property that does not exist. It would be nice to get a warning, either at compile or runtime, about my e...

Entity Framework Foreign Key Table isn't saving changes made to its BindingSource

I have two tables: CREATE TABLE `Vehicles` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, ... Other columns PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 And: CREATE TABLE `VehicleOptions` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `VehicleID` int(10) unsigned NOT NULL, ...

Provide value on 'System.Windows.Data.Binding' threw an exception

I am adding a validation rule to a textbox (following examples on WPF 4 Unleashed by Adam Nathan) When starting an application, I am faced with the following cryptic error message Provide value on 'System.Windows.Data.Binding' threw an exception What does the error mean and what needs to be done to address the problem? Here is...

Ui Doesn't getUpdated

this is my code: <Window x:Class="WpfApplication1.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window2" Height="300" Width="300"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="60*" /> <RowDefinition Height="202*" /> ...

Set DataBindings property for UserControl from VS designer

I've created simple UserContorl(WinForms) that consists of 1 TextBox(Txt) control, also i created property "Txt" that return this control(Txt). Now when i try to set DataBindings for this contorl from the VS designer through Txt property, it failed. i.e. you can set the property, but if you close vs designer and open it again DataBinding...

Question about Data Template or Style in WPF xaml

Hi, I have a textbox that has the following simple XAML (not necessary to read it - just have it for reference): <TextBox Name="m_ctrlUserDeviceType" Style="{StaticResource textStyleTextBox}" Text="{Binding Source={x:Static api:MySettings.Instance}, Path=UserDeviceType, ValidatesOnExceptions=true, NotifyOnValidationError=true}" Validati...

WPF usercontrol dynamic itemsSource

I've got a UserControl with a ObservableCollection member. In the UserControl i have a ListBox and i want the ListBox ItemsSource to be the the UserControls ObservableCollection. UserControl: public partial class Timeline : UserControl { public ObservableCollection<TwitterStatus> Tweets = new ObservableCollection<TwitterStatus>();...

Coerce a WPF TextBox not working anymore in .NET 4.0

In my WPF application I have a TextBox where the user can enter a percentage (as int, between 1 and 100). The Text property is databound to a property in a ViewModel, where I coerce the value to be in the given range in the setter. However, in .NET 3.5, the data is not shown properly in the UI after being coerced. In this post on MSDN, ...

CheckBoxList binding needs second collection to determine checked status

Hello, I have a situation where I need to databind a string array to a CheckBoxList. The decision if each item should be checked, or not, needs to be done by using a different string array. Here's a code sample: string[] supportedTransports = ... ;// "sms,tcp,http,direct" string[] transports = ... ; // subset of the above, i.e. "sms,ht...

Binding a ListBox specific item background to a specific value

Hi, I'm rather a newbie with WPF and still playing with bindings and such, so this probably a basic question. Consider the following class: class DataHolder { public List<int> Data; // Points to one of the items in Data. Thus can be between 0 and Data.Count public int Pointer; } I've set a ListBox's DataContext to be an...

LinqDataSource - is default insert parameter with dbnull value possible?

I need to do some simple (or so it seems) databinding and CRUD type operations on an ASP.Net page. I'm using a LinqDataSource connected with a FormView. The table that i'm trying to insert into has default contraints for these fields: [Created] [datetime] NOT NULL [CreatedBy] [nvarchar](50) NOT NULL [Modified] [datetime] NOT NULL [Modif...

ASP.Net master/detail w/Databinding to DataSource objects - multi-insert with all-or-nothing principals

My goal is to allow the user to enter order header and detail data and have it all save with a single button click, in one transaction so the save is all or nothing. For example: Tables: OrderHeader: Id, CustomerId, Comments, OrderDate, OrderLine Id, OrderId FK => OrderHeader Produ...

WPF Binding to objects.

I'm trying to reset data in my object bound to a simple form (some textboxes and a couple of buttons). I have 2 objects that were created separately, but have the same information. Object 1 is bound to a form using DataBinding. Object 2 is there to be able to reset Object 1 to original values. Whenever user edits data everything is fine...

LINQ to SQL Classes with INotifyPropertyChanged and IDataErrorInfo for WPF bindings

I use the LINQ to SQL Classes to access to my database. Now I want to use the LINQ to SQL Classes for WPF DataBindings and validation. How do I implement these two interfaces to my projects Model? Is it possible implement INotifyProperty automatically? ...

PRISM UserControl and ServiceReference

I'm using MVVM in my project and here is my question. I have a View and corresponding view-model with service reference. This view contains UserControl, which have another UserControl and it also contains nested UserControl. Last UserControl have a method which creates a popup. And in this popup i need service reference from view model. ...