databinding

How do I bind to something outside a datacontext.

I have a listbox in WPF that is in the Layout Root. I also have a Frame that is in the Layout Root as well. The listbox is composed of items that have a string(Name) and a framework element(UI). How do I bind the frame's content to be the UI property of the listbox's selected item property? If you need a codebehind, how would you do ...

Get a string representation of a property in C# at run-time

I have seen the reverse of this question quite a few times, but have not seen how to do what I would like. Suppose I have the following code: var myNewData = from t in someOtherData select new { fieldName = t.Whatever, fieldName2 = t.SomeOtherWhatever }; If I wish t...

Open-source projects using C++ and XML data binding

I'm looking for open-source projects that make use of two things: (1) C++ and (2) XML data binding. For those who don't know, data binding tools make use of XML schema and code generators such as Codesynthesis xsd, Liquid Technologies. I know CIAO/DAnCE project, an implementation of CORBA Component Model that uses XML Schema Compiler (XS...

Silverlight: Strange Databinding Problem

I am using the Visifire charts to display data on a Windows Phone 7 application. I created a chart that was properly bound to a dependency property. It worked great. I decided to make the chart into a user control, since I was going to use it in another project as well with the same setup. Now my databinding doesn't work unless I bind it...

Binding Events that are Unknown

I have a WPF Listbox filled with children that fire events. Now, I am dynamically loading each of the children but I want to hook up the events to a handler. Basically, each time one of the children give me a notificationEvent(Notification n), I want to add the Notification (n) to an observable collection. How would I do this so that n...

Silverlight 4 DataBinding: Binding to ObservableCollection<string> not working anymore

Upgrading from SL3 -> SL4. First problem: this throws a parser exception: <StackPanel Name={Binding} /> (same with x:Name) Collection is ObservableCollection<string>. Worked fine in SL3. So it seems that SL4 doen't allow binding to the Name property. Huh? So: changed to <StackPanel Tag={Binding} /> ... since I just need to ID the ...

Displaying multidimensional data in WPF

What is the best way to display multidimensional data in WPF? I won't know the size/shape of the data until runtime. Ideally I would like to use databinding but that is not a strict requirement. I was thinking some sort of grid but I don't know how to dynamically bind to the data and have it figure out the number of rows and columns. Sug...

Does use of Eval & Bind in ListView effects the performance?

In my Listview i am binding data using Eval and Bind. So Does use of Eval & Bind in ListView effects the performance? If yes then why? ...

Is it possible to bind a name property of an element ?

I have a grid with repeated columns with same style but different names the name are important for me in code behind so i decided to create a template to repeat the element and read the names from an XML file but i found out i can not use binding for name property please kindly help me sooooooooooooooooooooooooooon here is a part of my ...

Create multiple inline elements in a text block using databinding

I want to take the following xml node <fragment> <b0>This is normal</b0> <b1>This has a yellow background</b1> <b2>This has a red background</b2> <b0>Back to normal</b0> </fragment> And use data binding to create <TextBlock> <Run>This is normal</Run> <Run Background="Yellow">fragment</Run> <Run Background=...

How to implement one way binding collection for Listbox DataSource?

I have seemingly simple problem in Winforms. I want to implement a collection that can be used as a DataSource for a listbox. I intend to use it for simple strings. Like so: MyBindingCollection<string> collection = new MyBindingCollection<string>(); listbox.DataSource = collection; I've read that all I need to implement is IList inte...

WPF Binding to IDictionary<int,MyType>.Values Doesn't Respond to Property Changes?

I am binding a ListView a property that essentially wraps the Values collection (ICollection) on a generic dictionary. When the values in the dictionary change, I call OnNotifyPropertyChanged(property). I don't see the updates on the screen, with no binding errors. When I change the property getter to return the Linq extension dicti...

WPF: Checkbox in a ListView/Gridview--How to Get ListItem in Checked/Unchecked Event?

In the code behind's CheckBox_Checked and CheckBox_Unchecked events, I'd like to be able to access the item in MyList that the checkbox is bound to. Is there an easy way to do this? <ListView ItemsSource="{Binding Path=MyList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" MinHeight="100" MaxHeight="100"> <ListView.View> <Gri...

How can I modify a custom object in an ASP.NET FormView based on a button click?

NB. I am going to be away until Tuesday next week. So all help is appreciated but I will be unable to comment/respond until then. I have a FormView that modifies an instance of a custom class. The various form controls (TextBox, DropDownList etc.) are working fine. However, I want to include a Button that will modify the state of the Da...

How to databind a DependencyObject is SL4 in code behind ?

I saw that SL4 support binding on DependencyObject rather than FrameworkElement... This works fine in xaml, however I need to do that in code behind. However I don't see any method "SetBinding" in the DependencyObject class, how can I do ? Thanks for your responses ...

Nested form data binding with Lists of Objects in Spring MVC

Hi, I have an object like so: public class FormFields extends BaseObject implements Serializable { private FieldType fieldType; //checkbox, text, radio private List<FieldValue> value; //FieldValue contains simple string/int information, id, value, label //other properties and getter/setters } I loop through a list of FormFields a...

WPF suppress load of databound text field on init form

Is there any way to defer the databinding until a field is changed for the first time? So basically, when the app first loads, I want the numberic textboxes to be blank instead of all being 0. Total WPF n00b here so please change the title if there is a better way to describe the problem! ...

Databinding a property with a parameter

I would like to databind to a property that requires arguments. What is the best way do to this? are there work arounds? I'm open to any suggestions. I thought about defining custom columns and cells because the parameters that the property requires are available from the within the object bound to the row, but I'm having trouble mater...

How can I force WPF to make data bindings without showing the window?

I want to unit test a WPF application and one scenario is to check that data bindings are correct. The simple way to do that would be to create the form, force it to bind to data and then compare the values from the controls with the expected ones. Is there any way to do that? ...

Telerik RadGridView problem

I am using Telerik RadGridView in my project. I want to show image in column. GridViewImageColumn col1 = new GridViewImageColumn(); col1.Width = 100; col1.DataMemberBinding = new Binding("id"); col1.Header = "PhotoByConverter"; col1.DataMemberBinding.Conver...