databinding

How do I design backing data types for a databound WPF dialog with Ok/Cancel buttons?

I've created a table in Microsoft Sql CE that I'm using to hold some data. I've generated an ORM via SqlMetal and I've pulled the datasource into my WPF project. I want to create a simple WPF form that can be used to edit a record in the table via the ORM-generated classes. I want this form to support typical OK/Cancel semantics. I'v...

Data binding to a list inside a data bound object

I'm new to WPF and data binding so hopefully I can explain the problem I'm having with enough detail to get some help. I have a list of objects that is data bound to a window. Let's say its a list of recipes. I have managed to get the application to display some details of each recipe in a list box, and some more details of the selected...

On-demand IEnumerable binding to ListBox

I've got a potentially rather large list of objects I'd like to bind to a ListBox in WPF. However, I'd like to have the List load itself incrementally. How can I bind a ListBox to an IEnumerable that loads itself on-demand in such a way that the listbox only tries to enumerate as much as it needs for the display? ...

ASP.NET: Casting XPath to bool - Possible?

Greetings! I have an XML value that I'd like to use as a boolean value to toggle the visibility of a Panel. I have something like this: <asp:FormView id="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <!-- some stuff --> <asp:Panel id="MyPanel" runat="server" Visible='<%# (bool)XPath("Men...

Client-side table rendering with extremely large data tables

Problem: Customer X has requested that pages using XML DataBinding and Databound tables in MSIE be re-factored to work cross-browser. Question: What is the best-practice way to mimic the MSIE DataBinding feature of MSIE cross-browser (i.e., in both MSIE and Firefox). Features: Customer X already gets the following using MSIE DataBindin...

Hierarchical data binding with nested ListViews in WPF

I have some data that has a detail table. I want the data to be presented in a ListView. I want the detail data to appear as a nested ListView when you select an item in the original list. I can't seem to figure out how to get the data binding to work. Here's what I have so far, (the problem is the {Binding Path=FK_History_HistoryItems}...

Can you bind the selected item in a listbox to a separate object in WPF?

If I have two objects, one being the list of items, and the other having a property storing the selected item of the other list, is it possible to update the selected item through binding in WPF? Lets say I have these two data structures: public class MyDataList { public ObservableCollection<Guid> Data { get; set; } } public class...

WPF Docking Manager with Databinding support

Hi, Does anyone know about a Docking Control like Visual Studio for WPF, where Databinding for the Panes is supported? I tried the DockManager from Infragistics and from Actipro, but they lack this support. For example, the Panes for the content need to be bound through Databinding, so removing the Entity on the other side of the bindin...

C# data binding doesn't update WPF.

I'm trying to do a Data Binding in the C# code behind rather than the XAML. The XAML binding created in Expression Blend 2 to my CLR object works fine. My C# implementation only updates when the application is started after which subsequent changes to the CLR doesn't update my label content. Here's the working XAML binding. First a ...

Binding DropDownList DataSource to an XPathSelect

Greetings! I have some XML like this: <Root> <MainSection> <SomeNode>Some Node Value</SomeNode> <SomeOtherNode>Some Other Node Value</SomeOtherNode> <Areas> <Area someattribute="aaa" name="Alpha" value="0" /> <Area someattribute="bbb" name="Beta" value="1" /> <Area someatt...

Rebinding on Postback Based on Selected DropDown Value

Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <h1><%# XPath("SomeNode")%></h1> <asp:Label ID="MyLabel" runat="server" AssociatedControlID="MyDdl" Text='<%# XPath("SomeOtherNode")%>' /> ...

Can't Rebind FormView Control on Postback

Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <h1><%# XPath("SomeNode")%></h1> <asp:Label ID="MyLabel" runat="server" AssociatedControlID="MyDdl" Text='<%# XPath("SomeOtherNode")%>' /> ...

How can I underline a databound value from a DataTemplate?

If I want to display an underlined value in a TextBlock, I have to use a Run element. (If there's a better/easier way, I'd love to hear about it.) <TextBlock> <Run TextDecorations="Underline" Text="MyText" /> </TextBlock> Ideally, to implement this within a DataTemplate, it would look something like this: <DataTemplate x:Key="under...

How do you concatenate text when using Bind expression in asp.net

What is the syntax to concatenate text into a binding expression for an asp.net webpage (aspx). For example if I had a hyperlink that was being bound like this: <asp:HyperLink id="lnkID" NavigateUrl='<%# Bind("Link") %>' Target="_blank" Text="View" runat="server"/> How do you change, say, the Text to concaten...

Bind an ObjectDataSource to an existing method in my Data access layer

I've seen the designer code, and I have seen code which builds the ObjectDataSource in the code-behind, however both methods communicate directly with the database via either text commands or stored procs. This seems like unnecessary code duplication to me since my data access layer has a method already which returns a datatable with the...

What is a good way to display dynamic data in WPF?

I am struggling with the best way to handle a WPF application that has dynamic data updates. Should I use the rich data binding provided by WPF or not? I will simplify my problem domain as much as possible in the discussion below, and briefly mention some solutions. I am very interested in whatever comments this community can provide. ...

Databinding ListView including its columns

I have a list of objects where each contains an arbitary number of parameters (name,value pairs). Now I want to bind the list of objects to a listview. Each column should represent a parameter (the column header is the name of the parameter) and each row an object with the list of parameter values. How can achive that the columns includi...

How to databind to a property on a collection behind a collectionviewsource?

I currently have a collection with a HasChanges property on it (each object in the collection also has its own HasChanges property) and the collection is the source of my CollectionViewSource. When I try to databind the HasChanges property of the collection behind the CollectionViewSource to one of my custom controls, it binds to the Ha...

Silverlight: How to force binding after setting the DataContext property

Is it possible to set the DataContext property of a usercontrol after the user control has been loaded, and force the usercontrol to rebind? ...

Silverlight Databinding - Binding a ValueConverter to a property on a view-model

Let's pretend I have the following xaml... <UserControl.Resources> <local:ViewModel x:Name="viewModel" /> <local:LoadChildrenValueConverter x:Name="valueConverter" /> </UserControl.Resources> <UserControl.DataContext> <Binding Source="{StaticResource viewModel}" /> </UserControl.DataContext> <Grid x:Name="LayoutRoot" Bac...