databinding

( DetailsView control )Insert mode using EditItemTemplate as a blueprint

Hello, I’m trying to learn the inner workings of DetailsView object when operating in Insert mode, but it’s a bit confusing. 1) Assume DetailsView is bound to ObjectDataSource: A) When DetailsView’s field only defines ItemTemplate and EditItemTemplate, but no InsertItemTemplate, then when control is put into Insert mode, field ...

Dynamically populate an InfoPath DropownList with managed code

I have an InfoPath form with custom C# code, and a Sharepoint list. I have a dropdownlist in the InfoPath form that I want to populate with a certain field from the Sharepoint list (I want the InfoPath dropdownlist to contain this field's value from every item in the Sharepoint list. I can successfully get the list of values I need fro...

WPF Master-Details view with Listbox and Combobox with Binding

I've been looking around for an answer to my question for a few days now, but am not able to find a solution. The problem is that the combobox updates the Test object in User class with the the previous selected Users'. i.e. you select user2 and user2 has test2, you then select user5 that has test5. Now if you select user2 again, it w...

How do I do 2 way databinding for DateTime fields using ObjectDataSource

I have an ASP.Net 3.5 page that contains a FormView control, bound to a Business Object using an ObjectDataSource. One of the properties of the business object is a DateTime type, and I want to do 2 way databinding for this object, including the DateTime property. I use a custom format for displaying the DateTime property, as shown her...

ObservableCollection FileSystemWatcher ListBox Updating Issue

I have an ObservableCollection that is using a FileSystemWatcher to automatically add other PNG images that have been added to the directories. The ListBox has the ItemsSource databound to the Photos object using the following XAML. <ListBox ItemsSource="{Binding Source={StaticResource Photos}}" IsSynchronizedWithCurrentItem="True"/> ...

Binding for an EntitySet is displaying values that aren't there?

I'm binding an ItemsControl to an EntitySet in a WPF application. Its not acting as expected, however. The ItemsControl is behaving as if it is caching the contents of the EntitySet between binds! Here's the stripped down code: The entity: public partial class Item : INotifyPropertyChanging, INotifyPropertyChanged { private Enti...

Can't get DataBinding to work with an image as a background of a border

I've run into a problem with WPF when I try to use DataBinding with an image as a background to a border. I have no problem rendering the image this way: <Image Name="imgPlayer" Width="100" Height="100" Source="{Binding Converter={StaticResource ImageConverter}, Path=Image}" /> My DefaultImageConverter just checks if the image is...

Databinding the color of a RadialGradient brush in silverlight 3

Hi, I am trying to databind the color of a RadialGradientBrush in silverlight 3 to a property, but just can't seem to get it to work. For example, in a sample test app all I have is <navigation:Page x:Class="SilverlightNavigator.HomePage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Name="HomePageUC" x...

Binding DisplayValue to a different Source than the Control's DataSource

Say I have Tasks and Employees, each with their respective table in the database. There would be a many to many relationship between them, and as such there would be a third table for Assignments. If I create a listbox that is bound to a AssignmentsBindingSource I do not have the name of the employee to display. Is there a way to get ...

Change Background Color for WPF textbox in changed-state

I have a class EmployeeViewModel with 2 properties "FirstName" and "LastName". The class also has a dictionary with the changes of the properties. (The class implements INotifyPropertyChanged and IDataErrorInfo, everything is fine. In my view there is a textbox: <TextBox x:Name="firstNameTextBox" Text="{Binding Path=FirstName}" /> Ho...

Undoing All Changes Since BindingSource's last EndEdit call

Here's the scenario (which uses a BindingSource bound to a DataTable within a DataSet): A user creates a new address book contact, fills in the First and Last name in data-bound controls. He presses Apply, whose event handler calls BindingSource.EndEdit(). He then realizes there was a mistake, and adds an email address. But when he pre...

WPF ListBox + Binding + IDataErrorInfo = ?

I have a WPF MVVM application. In the View I have a multiselect ListBox. In the ViewModel I have a property for the selected items in the List. Using a technique similar to the one in the answer to this question I can bind my property to the ListBox. But I also want to do data validation via IDataErrorInfo. All I want to do is check th...

Binding to a property defined by binding on another property

I've got a problem which has been tormenting me for the last couple of days. I have a grid (Infragistics) to which I've applied a CellPresenterStyle which will change the contents of the cell to a ToggleButton if The cell is in the currently selected row, and The databound field is contained in a collection in my ViewModel The last p...

Why this DataBinding does not work?

I really don't know why this doesn't update the database, Anyone can help me? SetMasteraAdapter(clsLabWork.LabWorkMaster, "LabTestMaster"); dtaMaster.UpdateCommand = new SqlCommandBuilder(dtaMaster).GetUpdateCommand(); txtLabNo.DataBindings.Add(new Binding("Text", dtsMaster, "LabTestMaster.LabNo")); txtSaleMan.DataBindings.Add(new B...

How to parse XML-feed using asp:XmlDataSource and XPath

I'm trying to list vacancies in a asp:GridView using an XML_feed through an asp:XmlDataSource. This should be kinda simple, but I'm missing something with my XPath-expressions.. This is a short example of what I'm trying to achieve (list title of vacancies): <asp:XmlDataSource ID="XMLsource" DataFile="http://demo.easycruit.com/export/...

DevExpress LookUpEdit Problem

This should be a fairly easy task, however I'm a bit stumped, I have a LookUpEdit control, I have databound it to a datasource and set the displaymember and ValueMenber correctly. This control is now correctly populating. My problem is that normally I would pull some data and then 'set' it to the ID eg: LookUpEdit.EditValue = [Some ID...

design time usercontrols - I can't see anything!

newbie question, please forgive... I'm developing a Wpf UserControl that will eventually be bound to a business object. The usercontrol is little more than a series of laid out TextBlocks, and perhaps (later) an image or two. As I'm laying out the usercontrol, I can put dummy text into all the TextBlocks so I can see what the usercon...

How do I Add a new row to a datagridview without using a dataset or datatable?

I'm using a List to bind to a dataGridView. I'd like the user to be able to add a new row. I've tried using a BindingList and a BindingSource. Here's my binding (not including the combo box column I add to the datagridview before adding a datasource: binding = new BindingSource(); binding.DataSource= _Rows; _dg.DataSource = binding; ...

How do I bind a list of objects with composite-key to a checkbox list?

I have a list of objects that contain a composite key because of the legacy database that supports multi-tenancy. How can I then bind that list to a checkbox list in asp.net? We're currently using c# 3.5. Here's the class: public class SiteKey { public int Id { get; set; } public int CustomerId { get; set; } } public class Orde...

How can a string array be databound to a ListBox?

I'm relatively new to .NET GUI programming using WinForms (the project I'm working on is targetting .NET 2.0 for deployment reasons), and I'm trying to bind a ListBox in a Form to a string[] property that is defined in the form: namespace AVPriorityUI { public partial class AVPriorityUI : Form { public AVPriorityUI() ...