databinding

How do I get label value as a parameter into a javascript function?

Hopefully this one is not too hard to understand but I just want the label values to be inputs into a javascript function. Might be better to explain with code: ASP.NET Label code: <asp:Label ID="LabelCL" runat="server" Text="A single int filled in by DB"></asp:Label> Page Source: <span id="ctl00_cpMainContent_LabelCL">7</span> ...

How to databind Click= to a function on the object and not the page

I'm using Silverlight, but I'd be interested in a WPF answer as well I have a list that is databound to an linked list of “Favorites”. Each favorite contains a name and a phone number. The list is bound to a DataTemplate that describes the graphical aspects. In the this template is a button – Dial. When you click on that button I wa...

Escape double quotes in asp.net Onclick string

I am trying to insert dynamic data into a onclick property for a control the code looks like this onclick="openRadWindow('<%#Eval("ID";) %>','<%#Eval("ParentObjectID") %>');" I cant get it to fire and the trouble seems to be the double quotes, what is the correct method on escaping the quotes so that this fires. ...

Silverlight 4 issue with databinding 2 editable values to each other and infinite loop

This is quite a tricky problem to explain, please bear with me! I have 2 NumericUpDown controls called ItemsPerPerson and TotalItems (as grid columns, but this may not be relevant). There is a variable NumberOfPeople (lets keep it at a constant 10 for simplicity's sake). TotalItems = ItemsPerPerson * NumberOfPeople (this is defined in ...

ASP.NET two way databinding with nested objects

Howdy, Recently I returned to ASP.NET WebForms programming and I've come across a problem that I'm sure was not an issue previously. I have a Customer object with and Address object, I can bind up to all the properties of the customer (including the address for display) but when the formview binds back it throws an exception say that...

Flex Databinding based on an displayobject size parameters.

Hey, I have a panel with absolute layout which has clipContents disabled. Now I want to have a component that always floats at the bottom of this container, so I set it's bottom property to the negative value of it's height This works too, except for that when the application starts the height of legend appears to be zero, so instead...

How to change the Combobox.Text property when Combobox is bound to data?

My scenerio is like this: At runtime, I bind ToolStripComboBox to array of struct: cbxTimes.ComboBox.DataSource = PlayTimeLengths; cbxTimes.ComboBox.DisplayMember = "Description"; cbxTimes.ComboBox.ValueMember = "Minutes"; The DropDownStyle of ToolStripCombobox is set to DropDown. Everything is working fine, I can select values from...

Is binding an ItemsControl to an ObservableCollection<T> more efficient than a List<T>?

I have a render-heavy item template in an ItemsControl and want to minimize the recreation of child item templates when ItemsSource signals a change. I am wondering if, because ObservableCollection can tell WPF precisely what has changed (as opposed to just the whole list), if it is more efficient in rendering changes to the collection, ...

Bind CLR object to WPF control using Microsoft Expression Blend

I have the following class Person: public class Person { public string Name { get { return name; } set { name = value; } } public string Nickname { get { return nickname; } set { nickname = value; } } private string nickname; private string name; p...

ASP.NET: How can I make data-binding work with dictionaries?

So I have a list of dictionaries defined as such: Public Class Table Inherits ObjectModel.Collection(Of IDictionary(Of String, Object)) End Class The problem is that I can't figure out how to make the DataGrid use the dictionary to look-up values instread of searching for property names. ...

Implement Binding List In a Control

Hi All, I have a (Image) User Control on a Winform .. I want to bind this Control to a binding list such that whenever the (images) collection changes the (images showing on the ) control also change. (should reflect the images within the collection). [something similar to an AsyncBinding List.] . Similar to how .net controls use Data...

How do I bind a ListView to an ObservableCollection in C++/CLI?

I've got a small app which will allow the user to select a number of files and then perform some processing. I was thinking I'd collect the files in an ObservableCollection of String^ (and probably expand this to a full class at a later date). The problem is I can't work out how to bind the ListView to the ObservableCollection. I've add...

Columnbased Databinding in .Net?

I am looking for a way to databind my objects columnbased. So one object will be represented by a Column and not like normal binding where an object is represented by a row. At the moment I am using Infragistics UltraGrid and create a DataTable from my BusinessObjects on my own and use it as a DataSource for the Grid. But I don´t like th...

Dynamically Bind XML to DataGrid in Silverlight

I've been trying to bind XML (via an XElement) to a DataGrid dynamically in Silverlight (specifically Silverlight 4, but any solutions in SL3 would be fine too) but have been unable to do so. I hope to do this dynamically (ie - no rigid business objects to represent the XML). What I'm hoping for in the end is a way to bind to any XEleme...

Rebinding all properties of all elements in the visual tree?

I know that I can rebind all instances of a specific property for a specific type of element, as in this method that rebinds the Text property of all Textblocks. public void Rebind() { foreach (var textBlock in LayoutRoot.GetDescendents().OfType<TextBlock>()) { BindingExpression bindExp = textBlock.GetBindingExpression(TextBlock...

Having trouble deciding how to wire up a UserControl with MVVM

I've been doing the best I can to try to stay true to the separation recommended by the MVVM pattern. One thing I haven't figure out how to do correctly has to do with initializing my UserControls. My most recent example of this has to do with a library that I wrote to talk to some low-level hardware. That assembly happens to have a U...

Why is the Binding Format event called twice?

I am playing around with data binding and noticed that the Binding Format is called twice upon loading the form in the code below. I thought it would only happen once when the test class TextBoxText property is fist bound to textbox1. Is this normal? If not, then what can I do to prevent it? Note, when I press button1 and it changes t...

edit databinded labels

I am creating a C# based windows form application. I have a dataview and I have binded various labels to this dataview. The problem is that all the text in the label comes directly through the binding. However I need to format the data before displaying it. I need to display the text in RED if the label value is >0 and the text in GREE...

Problem with DataView Sort

I am trying to fetch data from DB and loading the DB with the values fetched. Later I am sorting the Data in the Table based on Name, then I want to bind it with a CheckedListBox However, when I am trying to use the DataView class as shown in the code below, I see a flickering occuring while the displaying data and once all data is sort...

Content generated from ContentTemplate does not have DataContext of Silverlight ContentControl set

In my Silverlight 4 application, I have a ContentControl with its ContentTemplate property bound to a property in the data context. That works fine. However, the content of the template once rendered has its DataContext set to null. I would like the content to inherit the same DataContext as set for the ContentControl. Is there a way...