databinding

Binding to a read-only getter in AS3

Consider the following code: [Bindable(event="ReportHeaderVO_effectiveFromDateJulian_updated")] public function set effectiveFromDateJulian ( value:Number ) : void { _effectiveFromDateJulian = value; dispatchEvent( new FlexEvent("ReportHeaderVO_effectiveFromDateJulian_updated") ); } public function get effectiveFromDateJulian (...

DataAnnotationsModelBinder does not bind with a List<>

I am trying to use the Data Annotations Model Binder Sample to provide UI validation on my application. However it seems that this doesn't work if your ViewModel contains a property that is a generic list. Can anyone shed any light on whether this is the case? I'm using ASP.NET MVC 1.0 ...

Bind to Object Itself, Not One of It's Properties

Using Asp.net's Bind() method, how do I bind to the object itself, not one of it's properties? ...

What's a good way to map from service fields to Flex value objects?

I'd like a generalized approach to mapping from conventionally-named and conventionally-typed database objects, delivered using AMFPHP, to Flex/Actionscript naming conventions and types. I want to map naming conventions; SQL is case-insensitive, so our data model has column names like object_id. Convention, however, is that our flex o...

ASP.NET Web Forms: Is it smart to call a custom "Bind" method in a user control's property's setter?

I haven't touched ASP.NET Web Forms in years and I'm a bit rusty with it. I currently have a user control which has a list of editable articles, this user control contains another user control (EditArticle.ascx), which is not visible on load. EditArticle has a property called Article which reflects the article one could edit. However ...

How to get Flex 3 ComboBox width to adjust based on bound dataProvider contents having changed?

In Flex 3, I've created a ComboBox within an MXML component similar to the following: <mx:ComboBox id="comboBox" dataProvider="{_choices}" /> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; // etc... public function get choices():ArrayCollection { return _choices; } [Bindable] private var _choices:ArrayCollectio...

MVVM/Presentation Model With WinForms

Hi, I'm currently working on a brownfield application, it's written with winforms, as a preparation to use WPF in a later version, out team plans to at least use the MVVM/Presentation model, and bind it against winforms... I've explored the subject, including the posts in this site (which i love very much), when boiled down, the main a...

Populating DropDownList inside Repeater not working

I'm trying to populate a dropdown list inside a repeater, but I'm not being very successful. I'm probably using the wrong EventArgs e. Here's my aspx code: <asp:Repeater runat="server" id="criteriaScore"> <HeaderTemplate> <ul> <li class="header"><span class="item">Kriterie</spa...

Not able to set SelectedValue for DropDownList

This is a followup from http://stackoverflow.com/questions/1432790/populating-dropdownlist-inside-repeater-not-working. I'm adding a dropdownlist inside a repeater. Now I need to set the selected value, but that easier said than done... Here is my code: protected void criteriaScore_ItemDataBound(object sender, RepeaterItemEventArg...

DataGridView not updating when bound items are changed?

I have a DataGridView which I am binding like so: companies = new BindingList<Company>(PersistenceManager.Instance.RetrieveAll<Company>(SessionAction.BeginAndEnd)); bindingSource.DataSource = companies; potentialInvestorDataGridView.DataBindings.Add("DataSource", bindingSource, "PotentialInvestors"); The problem is when I add to the P...

WPF DataBinding to property in control

I Have A wpf UserControl with a property: private IEnumerable<PropertyBase> properties; public IEnumerable<PropertyBase> Properties { get {return properties;} set { properties = from property in value orderby property.Position select property; } } I want to create a ListBox that is bound to my Properties property with Pr...

WPF check if a dataproperty has an binding

Hej, I'm trying to make som general functionality for my ListView, so that the content of a ListView can be exported to CSV directly. I'm trying to achive this by getting the datacontext and analysing the ICollectionView for this. From here I have access to the all the objects from via ICollectionView via SourceCollection, in which I (...

Refreshing DataGridView bindings to a list when a row is deleted

I have a WinForm app with multiple DataGridViews bound to SortableBindingLists. Under some circumstances, I need to programmatically delete an item from the list that grid is bound to. I can't seem to get the DGV to recognize that it's data has changed, or, specifically, that it has fewer rows. I'm calling dataGridView1.Invalidate(), a...

WPF Nested ListBox Databinding using ViewModel

Hi All, This is a long one . I am adding code so that you can see what I am trying to do. Let me know if anything is not clear I am trying to get selected items from nested listbox in multiselct mode . Here is code ( removed lot of unwanted stuff) public class Item { public string Name { get; set; } public IList<Item> SubItem...

WPF: Stopping or reversing a selection change in a list box

Imagine this: you have a Master-Child window consisting of a list of items (the Master window) and a set of controls where you can edit the currently selected item (the Child Window). The child window has "Apply" and "Cancel" buttons. A user begins editing values. He then changes the selection, before pressing the "Apply" button. Your...

avoid ListView data binding on each page load

Is there a way to maintain the data in listview whenever I click pages in the pager?. Because,the data what I am displaying is static. So, I don't want to go to database again or put it in a session and rebind it. ...

How can I pass a reference to another control as an IValueConverter parameter?

I am binding some business objects to a WPF ItemsControl. They are displayed using a custom IValueConverter implementation used to produce the Geometry for a Path object in the DataTemplate as shown here: <ItemsControl x:Name="Display" Background="White" HorizontalAlignment="Stretch" Vertical...

Can we configure data source control to first perform update and only then select operation (when DataBind() is called manually)?

Hello, If we set GridView’s DataSourceID to SqlDataSource/ObjectDataSource and manually call GridView.DataBind(), then the select operation is performed first and then the update operation. But since select operation automatically resets edited values, data source doesn’t get updated, even though Updating and Updated events do fire. ...

IDataErrorInfo with complex types

I have an Address object defined simply as follows: public class Address { public string StreetNumber { get; set; } public string StreetAddress { get; set; } public string City { get; set; } public string PostalCode { get; set; } } Fairly simple. On the advice an answer to another question I asked, I am referring to th...

WPF: TextBox dataBinding not happening if you activate button with mnemonic

Suppose you had a text box bound to a property of a data item, and a button. If you enter text in the text box, then click on the button with the mouse, the following events happen in this order: The text is written from the control to the bound item The button click event is fired However, if you activate the button with a mnemonic ...