databinding

Databinding exception with entity navigation property

I have two Entity classes: Order and OrderItem. Order contains a navigation property OrderItemSet of type System.Data.Objects.DataClasses.EntityCollection<OrderItem> On an aspx page is a FormView bound to this EntityDataSource: <asp:EntityDataSource ID="EntityDataSourceOrder" runat="server" ConnectionString="name=EntitiesContext...

Binding a WPF ShortCut Key to a Command in the ViewModel

Hi, I have a WPF app that is using the MVVM pattern. Hooking up buttons to the VM is pretty straight forward since they implement the ICommand. I have a context menu that works similar. The next step is to create shortcut keys for the context menu. I can't figure out how to get the shortcut key invoke the Command. Here is an example: ...

Get the details of the current row when using a typed dataset/binding source in a winforms application

I want to delete the current row in a grid only if a specific value exists in a column. How can I get the details for the current row? ...

Bind list from FormView to model in ASP.net webforms

For a large fillin form I use the asp.net FormView for the magic databinding to my model. In this model I've a property called Rides (shown below), which exposes a list, which I obviously not want to be replaced entirely. So I made it readonly. However, this way I can't use the databinding features anymore. Is there a common solution fo...

ASP.NET DropDownList with DataSource doesn't select any item

I'm using a DropDownList with a data source which successfully populates the list. However, I want one of the items to be selected, namely the one where the value matches the path and query of the current request. ddlTopics.DataSource = pdc; ddlTopics.DataBind(); foreach (ListItem item in ddlTopics.Items) { item.Selected = item.Valu...

Databinding Not Updating When Using {Binding .} or {Binding}

I have an ObservableCollection of addresses that I am binding to a ListBox. Then in the ItemTemplate I am Binding to the current address record using {Binding .}. This results in my addresses displaying using their ToString method which I have setup to format the address. All is good, except if I update properties on an individual addres...

Silverlight 3 Chart Usercontrol, need to change/set legend title

I have a chart in a user control. As I want to use multiple charts in the app, I need to set stuff like title of a series for each instance of the user control. It works fine so far, but I'm not able to bind a variable (e.g. seriesTitle) to a target in the user controls xaml. Please see following code: Using the user control in MainPa...

Extending a solution for simple binding to a 'Text property to multiple Controls to handle binding to any Type ?

My question is : how to move beyond writing a custom implementation of a technique for databinding multiple controls (controls without built-in DataSource properties), for each possible type of data, to simple properties ... as described and demonstrated in code that follows ... to achieve a more poweful solution that will be independent...

why asp.net binding expression shows nothing

I'm just testing a simple databind expression with: <div> Now: <%# DateTime.Now.ToString()%> </div> According to MSDN: http://msdn.microsoft.com/en-us/library/bda9bbfx(VS.71).aspx literal text <%# data-binding expression %> should work. When I compile, it's OK but I got a blank instead of Now DateTime. What's wrong ? ...

Entity Framework & Binding syncronisation

* EDIT * Sorry, I should make it clearer. Imagine I have an entity: public class MyObject { public string Name { get; set; } } And I have a ListBox: <ListBox x:Name="lbParts"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"/> </DataTemplate> </ListBox.ItemTemplate> </List...

Swing data binding frameworks

Hi Almost the same question has been asked a year ago, but the there has been some new development in this area. Selecting a (data binding) framework for swing application seems to be quite difficult. JSR-295 is abandoned, many swing frameworks which provide binding are work-in-progress, abandoned or too heavy for my quite simple app....

VB.NET Custom Object Master-Detail Data Binding

Since beginning to use VB.NET some years ago I have become slowly familiar with using the data binding features of .NET, however I often find my self bewildered by it's behavior and instead of discover the correct way it should work I find some dirty work around to suit my needs and continue on. Needless to say my problems continue to a...

BindingExpression with XPath cannot bind to non-XML object

System.Windows.Data Error: 43 : BindingExpression with XPath cannot bind to non-XML object.; XPath='CarModel/PercentFront/@Visible' BindingExpression:Path=/InnerText; DataItem='String' (HashCode=-671055389); target element is 'StackPanel' (Name='PnlPercentFront'); target property is 'Visibility' (type 'Visibility') CurrentCarConfig My s...

Is there a performance benefit to explicitly specifying OneWay binding when setting up bindings in WPF?

A project I'm working on is suffering from some minor performance issues. Our team is performing many small improvements to achieve larger gains in performance. We've managed to help the application out some by making some more obvious changes, and we've looked to data binding to provide some additional improvements. I know the default b...

Is there an equivalent to Spring:bind for binding forms and data on the front end?

I asked this question a few weeks ago and didn't get the answer I was looking for, so figured I'd ask again a little differently. I need to construct a form in my UI which will allow users to view and edit complex, nested objects. If I were doing this the JSP way, I would use Spring's bind functionality to associate form fields with bac...

Sort multiple columns while using a bindingsource or bindinglist

Hi everyone. I have a problem I am trying to fix and it's sorting a DataGridView on multiple columns. I have read that this option is not a feature built-in the DataGridView and I have to implement it. I have found multiple solutions, but none quite got to do the work. I'm also quite a newbie in C# and I don't know much of the .Net lib...

.Net BindingDictionary

I have started using BindingList(Of T) for my generic collections whenever I need the objects to interface with the GUI instead of List(Of T). This has worked well for me so far but a few of my collections are stored in Dictionary(Of TKey, TValue) and there doesn't appear to be a corresponding BindingDictionary(Of T). Has anyone else co...

WPF: Binding Hierarchy

I have defined a default binding in my style. For example I have configured the visibility binding of my button so that it must not be visible if the relative command can not execute. This is my default binding behavior. Apart from my default behavior, every view can customize the buttons it uses with another visibility binding. I w...

Why can I not bind Grid.RowDefinition Height in Silverlight?

When I run the following Silverlight app, it gives me the error: AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 12 Position: 35] I've tried the same code in WPF and it runs fine, i.e. the middle grid row correctly resizes based on the bound value. What do I have to change in this code to avoid this error in Silverlight? XAML: <UserCont...

Can an ICommand's CanExecute method be redefined dynamically?

I've been unable to find any info on this, which seems like it could be the only way to solve a past unanswered question of mine on SO. However, I think this should really be a separate question now. I am wondering if there is a way to dynamically redefine an ICommand-derived class's CanExecute method. I'm still new to .NET and perhap...