databinding

Silverlight databinding a textBlock in another user control

I have a small usercontrol that basically increments or decrements a value by one. The user control has two buttons(one to add and the other to subtract) and a textBlock that is used to display the value. I am going to have multiple instance of this usercontrol in another usercontrol so I can manipulate values of a dataclass that has an...

How do I databind a control in an item template to the item itself, and not one of its properties?

Hello, I've got a WPF ListBox that's databound to an ObservableCollection of type Employee. In the ItemTemplate, I'm binding the content of controls to various properties, as normal. But for one of the controls in the template, I've made a custom converter class that it uses, and I'd like the converter to get passed in the Employee obj...

Obtain values from current row when databinding

I'm using DevExpress XtraReports in a WinForms application, but could equally apply to other reporting tools. I'd like to perform some logic per-row in the report as it is "rendered", on a row-by-row basis. Specifically I'd like to hide a barcode if the data for the barcode isn't available. Currently I'm doing the following: priv...

Best way to bind controls in two windows in master-detail situation

Assuming that you have two windows where one window has a listbox and the other window should have the detail information for an item currently selected in the listbox. In one window this is easy enough to do but how would one do this with two windows? Unfortunately, two windows is the only option here. ...

WPF Bind DateTime to Date and Time EditFields

Hi, i am trying to build a gui that includes editing a DateTime value of an object. The DateTime Property has binding to a DataPicker and a normal TextBox for the Time. When i change the value in the Time TextBox the value wirtten in the DateTime Property is Today with the entered Time instead of just updating the Time, preserving the...

When does binding target get updated for complex paths?

When using databinding in WPF, the target dependency object gets updated when it is notified that the source has changed through the INotifyPropertyChanged interface. For example: <TextBlock Text="{Binding Path=SomeField}"/> The text field will change to correctly reflect the value of SomeField whenever PropertyChanged(this, new Pro...

Q: Telerik RadTree bound to XML DataSource

Hi, I have a Telerik RadTree bound to an XMLDataSource. I want to set a node's text to consist of 2 attributes (number and name) See <telerik:RadTreeNodeBinding> Example: "1. How are you?" and "2. How old are you?" XML: <questions> <question name="How are you?" number="1" imageurl=""> </question> <que...

How to get intellisense when doing XAML data bindings?

It would be nice if in XAML when I define ItemsControl/ItemsSource="{Binding AvailableContracts}" that Visual Studio would be smart enough to go find the property AvailableContracts on the ModelView which the DataContext is bound to, reflect it, and then when I type: <TextBlock Text="{Binding Path= it would pop up intellisense of the ...

WPF Handle links inside FlowDocument

Hello, I'm building simple dictionary application using WPF. I'm using MVVM pattern, databinding and FlowDocument to display words to user. UI consists of 2 controls: ListBox and FlowDocumentScrollViewer. Dictionary data comes from XML file, format of this string may look like this <b>Word</b> - Some description. Another <i>descrip...

How do you send complex objects using WCF? Does it work? Is it good?

Can I have a data contract of this shape?? [DataContract] public class YearlyStatistic{ [DataMember] public string Year{get;set;} [DataMember] public string StatisticName {get;set;} [DataMember] public List<MonthlyStatistic> MonthlyStats {get;set} }; I am assuming here that class MonthlyStatistic will also need to be a DataContrac...

How do you manually databind complex object to templated control like a row in a gridview??

I am struggling with the databinding syntax here. For example I have a data structure like this - public class Course{ public string CourseName {get;set;} public string CourseCode {get;set;} public List<Instructor> InstructorsTeaching{get;set;} } public class Instructor{ public string InstructorName{get;set;} public string Instru...

Silverlight - Binding with ObservableCollections

This is no doubt a newbish question, but I have looked for an answer to no avail. My setup is simple: I have a ListBox control defined in XAML and an ObservableCollection<MyClass> in the same class. I am binding the ObservableCollection<MyClass> to the ListBox. Within the hierarchy of this ListBox in XAML, I want to bind to a given My...

Silverlight - Binding to my UserControl causes ManagedRuntimeError

I am getting a run-time error when I use DataBinding, and it is driving me crazy. I have a simple UserControl that I have defined, let's call it SillyControl. Separately, I have a collection ObservableCollection<MyClass> myObjects; and a ListBox called SillyListBox which is bound to this ObservableCollection via: SillyListBox.ItemsS...

Data Binding to an object in C#

Objective-c/cocoa offers a form of binding where a control's properties (ie text in a textbox) can be bound to the property of an object. I am trying to duplicate this functionality in C# w/ .Net 3.5. I have created the following very simple class in the file MyClass.cs: class MyClass { private string myName; public string M...

HtmlEncode string within IQueryable without altering bound data

I'm binding an ASP.NET control to the result of a LINQ query. I'd like to HtmlEncode one of the properties of the contained objects before binding to the control, but I want to do it without altering the data because I do a DataContext.SubmitChanges() later on. How can this be done? Code that won't work: var ds = (from s in dc.Search...

Help! Data binding does not work in Silverlight on Mac

I have writen a small applet in Silverlight and, while it works fine on Windows, it seems that on OSX the data binding part of the application (all those NotifyPropertyChanged calls) do not work. Does anyone know why this is? I've tried under both Firefox and Safari with the latest 2.0 download installed. ...

WPF data binding and type conversion

I have a question regarding WPF binding and converting the data types seen by the UI objects in XAML. I have a user control that I would like to reuse in different applications. The user control displays a thumbnail image and several TextBlocks to display person demographic information such as name and address. The user control is used...

How to create a custom asp.Net Templated Databound Control ?

I would like to know if there is a good source of documentation for creating Asp.Net Templated Databound Controls or code samples for simple controls. All the documentation I have seen on the net seems way too complex. Is there a place where it is explained in a simple and easy to understand manner ? I could also be interested in text ...

If controls are always binded to data source controls in the order they are declared then

Hello, A) Question below is based on the assumption that controls are always binded to data source controls in the order they are declared? So in our example SqlDataSource1 will connect to data source prior to SqlDataSource2 and thus lstCities will be populated with values before GridView1, and reason for that being that lstcities was...

WPF ListView: Attaching a double-click (on an item) event

I have the following ListView: <ListView Name="TrackListView"> <ListView.View> <GridView> <GridViewColumn Header="Title" Width="100" HeaderTemplate="{StaticResource BlueHeader}" DisplayMemberBinding="{Binding Name}"/> <GridViewColumn Header="Artist" Width="100" HeaderTemplate="{StaticResource BlueHead...