databinding

Editing ObservableCollection's SelectedItem Without Bound Controls Seeing Edits Until They Are Saved

I have a view containing a ListView and an "Edit" Button. The ListView's ItemSource is bound to an ObservableCollection<Account> property on the underlying view model. Its SelectedItem property is also bound to the view model. When the edit button is clicked, the existing view model launches an editing view/view model pair ("editing s...

basic winforms question for dialog with lots of info - do you normally create an object and bind to this?

Hi, Basic winforms question I think. If I have a dialog where I'm collecting infomation, including some fields which will change depending upon the input of other fields, would it be normal/best practice to create an class/object to hold the various data, and then bind individual controls (e.g. text box, checkbox) to this object? i.e....

WPF: Binding Customized ListBox & List<T>: PropertyChanged is always null

Hello all, i have customized ListBox declared in XAML: <ListBox x:Name="uicMDSQonfServer"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Margin="0,5,0,5"> <CheckBox IsChecked="{Binding RelativeSource={TemplatedParent}, Path=Activated...

WPF, debugging databinding

Hi there I'm trying to understand the following part of an error message: Additional information: 'Provide value on 'System.Windows.DynamicResourceExtension' threw an exception.' Line number '118' and line position '56'. , what lines are the error referring to? No source files are mentioned.. ...

Databinding in style to property on parent window

Hi, Is it possible to declare a style that sets the fontsize of tooltips to the same size as the parent form? I have tried this... <Style TargetType="{x:Type ToolTip}"> <Setter Property="FontSize" Value="{Binding ElementName=MainWindow, Path=FontSize}"/> </Style> ...but that doesnt work. Any suggestions? ...

Only one text box updating with a databound source.

I have a bunch of text boxes bound to table adapters, when I fill my datatable only one box out of all of them will fill, txtEducator (there is only one row in the datatable). They are all configured exactly the same. I have debuged and there is data in most of the fields in the datatable, it just chooses to only show the one field. (I ...

Data Binding with Silverlight accordion Control

Hi I have Silverlight Accordion control in the ChildWindow and I customized it the following way <Style x:Key=itemStyle TargetType=AccordionItem> <Setter Porperty=HeaderTemplate> <DataTemplate> <TextBlock x:Name=_headertext/> </DataTemplate> </Setter> </Style> <Accordion Style"{StaticResource itemStyle}"> <Accordi...

wpf - updated dependency property not firing binding

I have the following dependency property: public bool IterationSelected { get { return (bool)GetValue(IterationSelectedProperty); } set { SetValue(IterationSelectedProperty, value); } } public static readonly DependencyProperty IterationSelectedProperty = DependencyProperty.Register("IterationSelected", typeof(bool), typeof(...

DependencyProperty with TwoWay Binding

I have a highly customized Edit control which inherits Richtextbox. I needed a way to bind a Value to this control, so I registered new DependencyProperty, but have trouble to code it like I need. public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(string), typeof(XliffRichCe...

System.ArgumentExceptions on startup of WPF application

We've created a custom theme for a WPF application. The styles in this theme use various bindings. On startup of the application a lot of Exceptions like this occur: System.ArgumentException occurred, Message="The requested value \"RecordFixToBottomPrompt\" could not be found.", Source="mscorlib", at StackTrace: bei System.Enum.Parse(Ty...

How to custom format data in datagridview during databinding

I'm looking a way to format DataGridViewTextBoxColumn so that the value to be databinded is formatted during databind. For example I have a CompanyName property and I need to take first 5 letters from the CompanyName when databinding happens. I could hook on different DataGridView events (e.g. RowsAdded) and loop through all the rows an...

DataBinding feedback in .NET2

I have a object myObject.Name in a Form1 with a textBox1 In the Form1_Load I do: this.TextBox1.DataBindings.Add("Text", myObject, "Name"); When validating the textBox I have myObject.Name changed. This is OK. Now I modify internally in myObject _name = "changed value", but myTextBox text will not change. so... how to do it on both di...

WPF bind to a list

I have a user control whose users I want to have them set a DataContext on to bind to a list of objects. In my control, however, I want to display that list in a grid, but in a non-trivial order. The column/row of display of each element will be determined by some code I will write. So I cannot do a straight databinding in my control,...

flex databinding with selectedItem property of the combobox update many times problem

Hi to all, well, I have a combobox which I have bind his selectedItem property to a value object object, like this <fx:Binding source="styles_cb.selectedItem.toString()" destination="_uniform.style"/> <fx:Declarations> <fx:XML id="config_xml" xmlns="" source="config.xml" /> <!-- Place non-visual elements (e.g., services, value objects) ...

Using a HyperlinkColumn with a Label Control or just basic Text

I have a situation where I currently have a HyperLinkColumn control that I would like to modify to have a Label or simple text appear in the same column as the hyperlink. How do I acheive this please? Any Idea? ...

Properties and Data Binding in .NET

One of the advantages that i hear about properties is that they can be used for databinding, while i hear no explanation of why beyond "that's how it works". Is it that way because there is no choice (i.e. a limitation of the .NET VM) or was it really designed that way, and if so why? ...

binding a collection to a setter method of a domain class in grails

I have a domain object with a setter method that takes in a map of id, value pairs. This is not just a plain association, and this setter method has some login in it. For example: class DomainObj{ def setTheMap(map){ //do stuff with the map } } I have a form where the user can type in a value for each id. My goal is that when ...

When should you not use an ObservableCollection and Databinding?

dhopton's comment got me thinking. What are some situations where you wouldn't want to use an ObservableCollection? ...

Using bindings to control column order in a DataGrid

Problem I have a WPF Toolkit DataGrid, and I'd like to be able to switch among several preset column orders. This is an MVVM project, so the column orders are stored in a ViewModel. The problem is, I can't get bindings to work for the DisplayIndex property. No matter what I try, including the sweet method in this Josh Smith tutorial, I ...

Synching object properties to DataTable

Hi all, I'm using a DataTable to sync some properties of a list of objects to a TreeView. When labels are edited, I want the relevant property of the relevant object to be updated, and labels to sync when the properties are changed elsewhere. Currently I'm updating the object's DataTable row when the property changes, and update the pr...