databinding

Bind a Command to a Button inside a ListView with Caliburn.Micro

Hi, I'm trying to create something like a MDI tabbed Interface so I have a navigation pane (a Listbox) on the left, and a ContentPresenter on the right. I have a ShellViewModel that has a BindableCollection on it called AvailAbleScreens and I managed successfully to bind to that list with a ListViews DataTemplate: <ListView x:Name="Av...

Binding is not updated as expected

Hello, I'm building a simple UserControl, DoubleDatePicker, which defines a DependencyProperty, SelectedDate : DoubleDatePicker.xaml : <UserControl x:Class="TestWpfDoubleDatePicker.DoubleDatePicker" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="h...

BindingSource, set datasource and then set a NEW datasource

Hi all, I've got a BindingSource with only 1 object as the DataSource. I bind on some values on the datasource. That works perfectly. BUT. When I do: bindingSource.DataSource = new Foo () { Bar = "..."; } this is not reflected through the UI. is there a way to force an update? I tried resetbindings on the controls that bind to...

Rounding a Value in the WPF Binding

I'm attempting to implement a progress bar with a textbox on top that also displays the progress %. However the percentage is fractional. Is it possible to round a value returned in the dataset via the binding or does it have to be done via the code behind? <ProgressBar Grid.Row="2" Grid.ColumnSpan="2" Height="25" HorizontalAlignment=...

C# WPF Linq to SQL Databinding

Hi, i have generated a Linq to Sql class which looks like this. so i have 3 querys which gets my data. private IQueryable<Gesellschaft> loadedGesellschaft; private IQueryable<Anschrift> loadedGesellschaftAnschrift; private IQueryable<Email> loadedGesellschaftEmail; private lgDataContext completeGesellschaft; private void Button_Cl...

Can a static property of a static class be a DataMember of a BindingSource?

I have static class that has a bunch of static properties. When I try to bind the property to a BindingSource (in the UI), I can pick the static class as the DataSource, however, when I drop down the DataMember combo, there is nothing there. Can I use a static property of a static class as a DataMember of a BindingSource? I should men...

WPF User Controls and DataBinding

Hi all, I guess I'm a bit stuck on the mechanism of WPF DataBinding. Up to now I've thought of it as this : Any target of a DataBinding has to be a DependencyProperty.Keeping that in mind, I designed a very simple button-based UserControl like the following (boiled down to the most necessary parts): XAML <Button x:Class="MyNamespace.I...

Flex 4 Problem using datagroup with XML and item renderer.

Hi, I have a Datagroup with a custom item renderer the momment I bind it to XML from an http service it stops working. My XML: <SDLIST> <chartlist> <reportname>FACTORY STATUS</reportname> <reportimage>file:/D:/Work/RapidReport/Images/Charts/Vertical-Linear-Gauges.png</reportimage> </chartlist> <chartlist> <reportname>FACTO...

Wpf: IDataErrorInfo not working with CollectionViewSource?

I have a ListBox bound to a CollectionView which again is bound to a property on a viewmodel. <ListBox ItemsSource="{Binding Source={StaticResource pumpCurvesViewSource}, ValidatesOnDataErrors=true}" /> Now, the viewmodel implements IDataErrorInfo, but the validation of the property on the viewmodel is never triggered. If I skip the C...

UserControl and binding paths--is it magic or logic?

I'm trying to confirm a binding behavior I believe I have observed, but I'm not exactly sure of. My original understanding was that a UserControl was sort of a black box, where if you wanted to share information back and forth with the controls contained within, you had to (1) use the DataContext or (2) define them on the surface of the...

Two way binding with UI quirks

I haven't really done a two way binding project before, so this might be a simple question. I have an business object with all the right interfaces (INotifyPropertyChanged, etc...). I bound a Int32 property called CPP to a textbox named txtCPP via a BindingSource. The rules state that if CPP is less than 0, the text box should be blan...

Spring MVC 3.0: How do I bind to a persistent object

I'm working with Spring MVC and I'd like it to bind a a persistent object from the database, but I cannot figure out how I can set my code to make a call to the DB before binding. For example, I'm trying to update a "BenefitType" object to the database, however, I want it to get the object fromthe database, not create a new one so I do n...

Prime examples of data-binding

I am implementing a barebones framework in JavaScript that just provides data-binding between objects. The data-binding can either be one-way or two-way, and potentially have multiple objects bound on some property. There are several data-binding solutions available for various languages and I am trying to get a good idea of the best of ...

Performance impact of Wpf Binding Path={x:Static <propertypath>} ?

I have a CLR instance property, a static PropertyPath which points to the instance property and a xaml binding which uses the static PropertyPath directly like so: NB: GetPropertyPath is simply a method which returns the propertypath based on the given linq expression from the member name. public static PropertyPath MyPropertyPat...

How to get the ListBoxItem for an item in ListBox on "bind-time"

I have a ListBox with Foo objects, and based on some events I disable/enable the ListBoxItems in the ListBox. Using the ListBox.Items property I find Foo objects, and from what I've understood I need to use the following function to get the ListBoxItem container for the Foo. Correct? foreach (var item in Items) { var lbi = ItemCont...

Binding ObservableCollection<Foo> to ObservableCollection<object>

I have a collection ObservableCollection<Foo>, and I want to bind this to a property in a custom controller of type ObservableCollection<object>. However, the bound value never reaches the PropertyCallback, and is hence never set. Is there a clever way to achieve this binding? I could create an IValueConverter that converts from Observ...

DataGridView and DataBinding with custom columns

My requirement is as follows, I am calling a procedure and I'm populating a DataTable. Assume that the procedure is returning emp_id, emp_name, designation and status. When I use DataGridView1.DataSource = <Name of the DataTable>, I get all the columns populated into the DataGridView. How can I display only selected columns in the DataGr...

Displaying and editing XML data with a WPF TreeView

Hi, I'd like to visualize XML data with the WPF TreeView control. The treeview displays all elements of the XML data in hierarchical order. Below the treeview is a ListBox containing TextBoxes for editing the name, the value of the element and all its attributes. I have figured out how to display the XML data in the treeview. But I don...

using Bindinglist as bind for Textbox

I have a bindinglist. i am using a textbox to show its items WithEvents xBind As New BindingList(Of Emp) I added items this way xBind.Add(New emp("alpha0", "B")) xBind.Add(New emp("alpha1", "B")) xBind.Add(New emp("alpha2", "B")) xBind.Add(New emp("alpha3", "B")) I am binding the first property to a textbox TextBox1.DataBindings.A...

How to determine which detail table raised Telerik radgrid NeedDataSource Event?

For a radgrid, in the GridNeedDataSource Event, the eventargs include: RebindReason IsFromDetailTable This useful for determining whether the rebinding is caused by Parent or Child grid. What if I have a 3-tier grid? Parent > Child > Grandchild This boolean parameter will only tell me whether or not the grid raising the event was the ...