databinding

Firing PropertyChanged event in a complex, nested type in WPF

I have a class called DataStore and a list of Departments (an ObservableCollection), and each department again has a list of Products. Properties in the Product class that are changed also affect properties in the Department and DataStore class. How does each Product notify the Department it belongs to, and the DataStore (which is the mo...

What is a good pattern for binding a collection of objects coming from WCF, in Silverlight?

Hi there, I've got a question about a Silverlight WCF Databinding pattern: There are many examples about how to bind data using {Binding} expressions in XAML, how to make async calls to a WCF service, set the DataContext property of a element in the UI, how to use ObservableCollections and INotifyPropertyChanged, INotifyCollectionChang...

Beginner question: What is binding?

Hi, I was trying to understand the difference between early and late binding, and in the process realized that the concept of binding is nebulous to me. I think I understand that it relates to the way data-as-a-word-of-memory is linked to type-as-a-set-of-language-features but I am not sure those are the right concepts. Also, how does...

How is WPF Data Binding using Object Data Source in Visual Studio 2010 done?

This is probably mostly a question about how to use the VS 2010 IDE tools in a way the Microsofties didn't specifically intend. But since this is something I immediately tried without success. I have defined a .NET 4.0 WPF Application project with a simple class that looks like this: Public Class Class1 Public Property One As Strin...

Binding to dynamic objects in Silverlight 4

I've noticed that in .Net 4, WPF FrameworkElements are able to bind to IDynamicMetaObjectProvider binding sources. Will this also be the case for Silverlight 4? ...

ValueConverter not invoked in DataTemplate binding

I have a ComboBox that uses a DataTemplate. The DataTemplate contains a binding which uses an IValueConverter to convert an enumerated value into a string. The problem is that the value converter is never invoked. If I put a breakpoint in StatusToTextConverter.Convert(), it never is hit. This is my XAML: <ComboBox ItemsSource="{Bin...

Data-binding taking too long to update

In my application I have this code in my view model: hiddenTextContainer.PreHideVerticalOffset = VerticalOffset; hiddenTextContainer.HiddenText = Text.Remove(SelectionStart, SelectionLength); hiddenTextContainer.HasHiddenText = true; hiddenTextContainer.NonHiddenTextStart = SelectionStart; ...

MVVM Group Radio Button

What is the best way of binding a number of RadioButtons to an enum using MVVM? The only way I can think of is binding each group box's IsChecked to a property, and in the setter of that property assign a value to an enum in the view model. Any help is appreciated. ...

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in ...

Hi, I'm working with PHP PDO and I have the following problem: Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /var/www/site/classes/enterprise.php on line 63 Here is my code: public function getCompaniesByCity(City $city, $options = null) {...

Databinding Error when Recreating object

Hi All, Figure there is a simple solution to this problem but I have been unable to find it. I have databinding in an ASP.Net application to a GridView. This gridview is bound to an ObjectDataSource as per standard usage. The problem I have is that one of my bound fields uses the property DataFormatString="{0:C}" and due to the curren...

Flex: Bind values in a List with ComboBox as Item Renderer

I am using a List with an ArrayCollection as a DataProvider. The list uses ComboBox as Item Renderer itemRenderer="mx.controls.CheckBox" I would like to bind the values in the List. You have a list with several comboboxes, and those values are loaded dinamically from an ArrayCollection. The ArrayCollection contains Objects with a ...

Data Binding Gridview to a Second Gridview

Good Morning, I am developing a quote request functionality as part of a website. The idea here is for the user to search for parts, update the textbox field in the first gridview for items they wish to select, click Add to Quote embedded in the first gridview, and send those rows to a second gridview wherein they can edit quantities o...

PieSeries in a listboxItem

I have a listboxitem whose datatemplate contains a pieseries. The listbox is bound to the class having a dictionary member. I want to bind that dictionary member to the pieseries. I have tried couple of ways, but it did not work. it is generating blank pieseries. The pieseries datacontext is being set to the datacontext of the listboxite...

ASP.NET Server Controls - Data Source

I put a dropdownlist on a webform and give a list as datasource. But what can I do, if I want the first item in dropdownlist to be "Select a user" or something like that? For example: // ddlAllUsers is a DropDownList List<REGUSER> users = UserOperations.GetAllUsers(); ddlAllUsers.DataSource = users; ddlAllUsers....

Wrapping with Dependency Properties

I've got a Windows Forms control that I'm wrapping with a WindowsFormsHost-derived class to access WPF's data binding functionality. The Forms control exposes properties that indicate its state, along with the standard property-changed event notifier. For example, a Zoom property on the Forms control is accompanied with a ZoomChanged ev...

DatagridView Background does not refresh. Traces left behind.

I have a DataGridView bound on a generic list, in .NET 3.5. When this grid is resized, there is a residual traces that is left behind on the background of the grid where there is no items. This only occurs where there is some columns that have the WrapMode attribute set to True. It seems that only the content that is wrapped is not refr...

How to delete a Item in a ASP.NET listview and persist the datasource?

I have a collection of objects I bind to a Listview like this: if (!IsPostBack) { List<Equipment> persons = new List<Equipment> {new Equipment{ItemName = "Sworn", ItemCount = 7, ItemCost = 255}, new Equipment{ItemName = "Civ", ItemCount = 3, ItemCost = 80}...

Is there a cleaner way to Bind property to owner's DataContext?

I have some code that looks like this: <Expander Header="{Binding SelectedSlot.Name}" Visibility="{Binding ShowGroupSlot, Converter={StaticResource BooleanToVisibility}}"> <Controls:GroupPrototypeSlotControl Slot="{Binding DataContext.SelectedSlot, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x...

How to create XAML like path bindings in C#.

The XAML {Binding} construct is very handy because it handles all of the PropertyChanged issues automatically. It is really impressive when you hand it a path to an object, through .NET data structures, and everything is automatically updated for you. I would like to use the same thing in C#. I would like to have a property that is de...

ASP Repeater Evals mixed with HTML

I want to include HTML and Eval within a Repeater: <asp:Repeater ID="Rpt" runat="server" DataSourceID="DS"> <HeaderTemplate><div id="gallery"></HeaderTemplate> <ItemTemplate> <a href='<%# Eval("Url") %>' class="show"> <img src='<%# Eval("Image") %>' alt='<%# Eval("Title") %>' title="" runat=...