databinding

How can I use multiple combo boxes with one datasource in WPF?

When I try to use the same list with multiple combo boxes, the selection is shared with all the combo boxes. I want the combo box to treat the datasource as their own and selection should not be shared. <ComboBox ItemsSource="{Binding ActiveLanguages}" DisplayMemberPath="Name" /> ActiveLanguages is a ObservableCollection and is a sin...

Flex binding not working

I'am having problems with, binding variables being updated. I've made custom TitleWindow component which have text-input and check-box control. When the check-box changes its value, the XML in parent application should also, but it doesn't nor does the warning: unable to bind to property Here is the code: <fx:Declarations>...

Command Binding in UserControl used as ListBox.ItemTemplate

I have a Listbox with a UserControl as the DataTemplate. This UserControl has a button to remove that item from the list. <ListBox x:Name="FileList" ItemsSource="{Binding Files}" > <ListBox.ItemTemplate> <DataTemplate> <Views:FileItem/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> The ItemSource is ...

Issue with WPF DataBinding to XML file

I'm in the process of creating a message application in WPF, as part of this I have a listbox which shows all the messages currently avaliable with the authors Title and Name. Anyway I'm currently in the developing but the data I wish to show isn't appearing but the titles do (Author: and Title:). Please be aware my XML file is a test th...

CheckedItems property for custom CheckBoxList control in Silverlight

Hi, I need to implement CheckBoxList control with ItemsSource and CheckedItems properties. Items from ItemsSource should be displayed as checked checkboxes if CheckedItems contains these values or unchecked otherwise. Also I need two-way databinding support for CheckedItems property (value of this property should be updated when user cl...

WPF validation: how can I skip validation for elements that are disabled?

I'm fairly new to WPF. In our current project, we've added validation rules for all data entry fields that we need validation for. We have also copied code (also posted elsewhere here at stackoverflow) that recursively loops over all bindings and their validation rules, in order to know whether or not all the data is valid before saving ...

WPF DataGridComboBoxColumn

Hello I'm using the WPF DataGrid and I'm trying to get the ComboBox Column to work. <tk:DataGridComboBoxColumn Header="GroupLevel" DisplayMemberPath="Type" SelectedItemBinding="{Binding Path=GroupLevel}" > <tk:DataGridComboBoxColumn.EditingElementStyle>...

binding in wpf/ C#

Hi I have a xml file which I want to edit using automatic data binding in my wpf application. Can anyone lead me into this please? For example, can I add all the xml contents into a treeview? More...if I modify the xml by hand, will the treeview auto-refresh with the new values? Thanks ...

Dynamically add a field to a collection in c#?

I have some basic dropdownlist databinding code. I need to modify the datasource at Runtime and insert a new field. ddlPrimaryCarrier.DataSource = FinancialInstitutions; ddlPrimaryCarrier.DataValueField = "EntityCode"; ddlPrimaryCarrier.DataTextField = "EntityNameDesc"; ddlPrimaryCarrier.DataBind()...

How can I bind parent/child ComboBox's against XML datasource?

I have the following XML (simplified example) which should have a parent/child relationship between two ComboBox's. The parent binds correctly but the child does not bind to the parents SelectedItem. When I set xmlns against the foobar XML and remove all namespace references it works as expected. Also if I set ItemsSource="{Binding XPat...

Silverlight data-binding - is it possible to temporary suspend

Hi I have a group of Siverlight elements that are bound to an object. I want to be able to suspend the databind (effectively freeze their current values) for some time (when the mouse hovers hover the containing panel). What's the best way to do this? There doesn't seem to be an easy way - one thought is to create a copy of the data ob...

Display a Default value for a Databound WPF ComboBox

I have a databound WPF comboxbox where I am using the SelectedValuePath property to select a selected value based on something other than the object's text. This is probably best explained with an example: <ComboBox ItemsSource="{Binding Path=Items}" DisplayMemberPath="Name" SelectedValuePath="Id" SelectedV...

WPF - Refresh contents of a DataTemplate

I have a tab that has its content set to an object (a TFS WorkItem). I have a DataTemplate for the WorkItem type. When I set the object to the tab it displays nicely. However, when I update one of the collections on the object (the list of links) this change is not refreshed to the view. I have tried making my WorkItem a DependencyPr...

Is there a way to follow a binding in code?

If i have a Binding which has a property path and the data source can i execute it in code, to find the value? The path that i am trying to follow can be quite complicated, including collection lookup and multiple levels. there is a hack : create a content control use BindingOperations.SetBinding() then retrieve the content is there...

Binding does not have a Clone method, whats an effective way to copy it

I wish to copy a binding, this is so i can set a different source property on it without affecting the original binding. Is this just a case of setting all of the properties on the new binding to be the same as the old? ...

Databinding question regarding change highlighting

Hi, A short discription of the application I'm developing is: It's a WinForms app, where the UI is databinded to some classes that implement INotifyPropertyChanged. That classes are updated by a background thread, and we want to allow the user to see what has been changed. The current solution in short: every setter of a property is ch...

Filtering bound XML data in WPF

Hello, Basically I have a WPF application that will display announcements to the user within a listbox. The information that populates the list box comes from a XML file which contains details about different announcements. I am then applying a data template to display the relevant pieces of information. What I have is two buttons at th...

WPF : Binding a combo-box to an enum property of a class object?

In the namespace X, I've got a public enum definition : namespace X { public enum MyEnum { val0=0, val1, val2, val3, val4 } } In the namespace Y I've got a class which has a property of the X.MyEnum type using namespace X; namespace Y { class Container { public MyEnum MYEnum { get { return m_myenum; } ...

How can you detect (and then change) the last row of a paged GridView during/after data binding?

I have a derived GridView control which implements an actions column with some ImageButton actions: Properties, Move Up, Move Down, Delete. I currently create these in the control's OnInit; the ImageButton controls are housed inside a TemplateField/ITemplate. I want to disable and show a different image for the Move Up and Move Down ...

WPF Binding FallbackValue set to Binding

Hello, I was wondering if there was a way to have another binding as a fall back value ? I'm trying to do something like this: <Label Content="{Binding SelectedItem.Name, ElementName=groupTreeView, FallbackValue={Binding RootGroup.Name}}" /> If any ones got another trick to pull it off that would be great. Thanks, Raul ...