databinding

Implementing a non-hierarchical Master-Detail pattern in WPF

I'd like to implement the Master-Detail pattern in my WPF application, so that when the user selects an item in a ListView its details are displayed elsewhere. However my data source (some XML) is not structured in a hierarchical manner; rather, each item stores a list of IDs which can be used to identify the details in another section o...

Binding to a Nullable<DateTime> control property

We have a custom control that has a "Value" property of type System.Nullable (aka System.DateTime?). We have an object with a "Received" property of the same type. When we try to bind the control to the object, the following InvalidCastException is thrown: Invalid cast from 'System.DateTime' to 'System.Nullable`1[[System.DateTime, msc...

wpf binding in c# to a filtered list

hi, I have recently begun development using c# and wpf. In our application we have a DataGrid object that we would like to bind to a list. However we do not want all entrys in the list to be bound, only those that meet a certain criteria. The reason that we cannot bind to a seperate list (ie. bind to a list created by the applying th...

WPF TwoWay data binding limitation

Is it safe to assume that WPF TwoWay data binding Wont work on controls which dont have focus ? For example in the following code. <Window.Resources> <XmlDataProvider x:Key="TestBind1" XPath="/BindTest1"> <x:XData> <BindTest1 xmlns=""> <Value1>True</Value1> </Bind...

ASP.NET Charting Control - Dynamically Adding and Removing Series of Datapoints

If you're familiar with ASP.NET's Charting controls, the Chart object contains a number of Series objects - which are series of datapoints that can be charted. Each series can be visualized in a different way (bar or point or line) on the same chart. I have a custom control that I use to create and remove and modify lists of Series in a...

How to select multiple values in a listbox inside of a gridview editItemTemplate?

If I have a dropdownlist I know I can.. SelectedValue='<%#Bind("AgencyID")%>' I want to do the same with a listbox but select multiple values. I was trying to use gridview.FindControl("listbox") but it always is null. Can someone guide me in the right direction? Thanks! ...

Databinding NOT working

Hi all, problem with binding... I have a "Detail" form with.. say 5 controls with buttons for add/edit/save/cancel/exit. I have a second "Find" form used to find a record from a back-end datasource. I get the selected record's ID and call the "Detail" form. The "Detail" form dynamically does the binding via textboxSample.DataBi...

DataBound UserControl and PropertyNameChanged Event problem in .net winforms.

I have a UserControl, with a TextBox and a databound property - Value. Value can be any object such as a Color, Array, Font etc. Any time the text changes, the property Value is changed as long as it is valid. Looking at the msdn article: How to: Apply the PropertyNameChanged Pattern , it says I should use the PropertyNameChanged Event...

how to dataBind a comboBox to result function call in Domain Sevices Class?

Hello, background: very new and limited knowledge on C# / Silverlight / .Net RIA Services Situation: I have a function in my Domain Service Class, which by calling a function in a Referenced DLL builds an ArrayList. But due to inability to pass ArrayLists to silverlight when using RIA Services i cast it and return a List to the client...

Binding to a collection of shapes?

How would I bind to a collection of shapes? I'd like to build a small application (just for learning purposes) where I utilize MVVM for drawing shapes. The DataContext of the MainWindow is the MainWindowViewModel That MainWindowViewModel has an ObservableCollection of shapes. I have currently only a Canvas on my MainWindow with it...

Bind to Property of Parent Element in Silverlight

I am trying to bind a property of an element within a UserControl to a property set on the UserControl itself in Silverlight. I'm sure it should be simple, but I haven't managed to get it working with either RelativeSource or ElementName binding. In this example I want the Rectangle to be Green (or whatever the UserControl's Background p...

asp.net datasource instantiate class

I have a static method that takes a parameter and returns a class. the class has a ReadOnlyCollection Property that i'd like to display in a asp:repeater. Is there a way to do this using LinqDataSource or ObjectDataSource? I got pretty close with ObjectDataSource, but since the method is returning a single class object, I couldn't get...

How do I render a column bound to a collection class as a child row in an Infragistics UltraWinGrid ?

I have a UltraWinGrid that is bound to a DataSet, in which a couple of columns are themselves of a collection class type, like so :- [Name] - string [Description] - string [Components] = List<Component> [Levels] = List<Level> Currently, these last two fields are hidden columns when bound to the datagrid and used to d...

WPF: What can cause a binding source to not be updated?

I have a situation I'm not sure how to debug. I'm hoping someone can suggest why it might not be working and point me in the right direction. I have a TIFF image from a database which is exposed as a property of type System.Data.Linq.Binary. I want to display the individual frames from that TIFF image in an ItemsControl so I've written ...

Binding the display value of a Collection's Properties to a ComboBox

Hi all, Let me first describe my goal: I have created an object with 3 properties: start, end and time. I have created an ObservableCollection of 8 of these properties, so it looks like this: //C# internal class MyObjects : ObservableCollection<MyObjectSetting> { public MyObjects() : base() ...

How to access property attributes on a data bound property in Silverlight?

For example, I have a simple textbox bound to a property: <TextBox Text="{Binding FirstName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" /> The property looks something like this: [Display(Name="Last Name")] public string LastName { ... } So, given the textbox, I would like to get the Display Name prope...

Dynamic filtering with an ItemsControl combobox

Hi, I have this situation where I want to display a list of Administration objects and a ComboBox for each Administration. Inside this ComboBox I want a list with Employees belonging to this Administration, along with an empty option. So I need to filter based on Administration. So far I've come up with the following code (note: object...

Customization of the binding of strongly-typed objects to datagrid

I have a class: class MyObject { float f; int i; } When a collection of MyObject instances are bound to a grid on UI, we have a default display of the instances (one object for one row), which probably calls float.ToString() and int.ToString(). My question is that, how to customize this default behavior? How to add in some format ...

Bound value for IValueConverter resets to default

I have bound a flagged enum to a bunch of checkboxes by using a value converter that works as described in the solution to this question. This works fine when I'm working with a flag that hasn't been set to anything. However, in the non-trivial use case that the flag is actually set to some data, on load the checkboxes are bound correct...

WPF datagrid header text binding

The column header of the DataGrid is not a FrameWork element for some reason, and so you cannot use bindings to set things like the header text. Please correct me if that is wrong of if that has changed with .NET 4.0 (I am using the latest WPFToolkit from CodePlex now). I am trying to use the DataGrid for a time sheet presentation where...