databinding

How to make a WPF ComboBox editable with custom values

I would like to have a combobox that allows selection from a list of values and also allow a custom value from the typed in text. For display reasons the items are a complex type (lets say the combobox item template displays a patch of color and a flag indicating if it is a custom color). public class ColorLevel { public decimal Int...

Databind InkCanvas Children

In a WPF application I have an ObservableCollection of objects (areas on an image) that I want to display and edit (size and position) at runtime. I would like to use an InkCanvas in Select mode with Rectangles representing my objects, but it doesn't seem to directly support data binding. Is it possible to somehow bind the Children co...

how to modify data in a DetailsView Databound event

I'm using a detailsview with an sqldatasource in the aspx page. I'm trying to do some pre and post processing on some of the fields - basically to convert a html list to a newline separated list for editing and back to html to store in the database. The post-processing in ItemUpdating is easy enough but the pre-processing in DataBound i...

My custom WPF RIchTextBox will not accept user input, even after setting IsReadOnly=false

I have written a custom Bindable RichText Box, so I can bind to the Document property. However, as soon as I set my document content, the only keyboard input it accepts is the backspace key (???). No other keyboard input is acknowledged (including the arrow keys). Any ideas? Here is the code of my BindableRTB class: Imports System.W...

[WPF and VB.net] load <document> node from XML into documentviewer control upon selecteditemchanged in treeview?

This is driving me absolutely nuts. I've got a WPF browser application that is somewhat like a content management system. We're going to use it for internal employees to get troubleshooting documentation. It consists of a Treeview, to hold all the topics, and a documentviewer control to display XPS documents. Currently, I have XML th...

Smartclient GWT making a ListGridRecord field editable using a custom DataSource

We're using SmartClient GWT library (see the Smartclient GWT showcase here). I'm trying to make a ListGrid UI that when you click a record the fields become editable. Just like the example: Grid Editing Mass Update The difference is I'm using my own custom GWT RPC services and manually adding ListGridRecord's to my own DataSource, a...

Where is the event handler method for the PropertyChaned event?

I write the following code to bind the data from a background object to a WinForm UI. I use the INotifyPropertyChanged interface to notify the UI of the property change. But I DIDN'T see any event handler been explicityly assigned to the event PropertyChanged. And I checked my assembly with .NET Reflector and still found no corresponding...

How to use MultiBinding in a WPF ComboBox

This is driving me NUTS!!! I have a ComboBox used to filter a query by employee which works fine but only displays the employees first name. I want to use a MultiValueConverter to display the employees full name (This would be less urgent if we did not have 2 Mikes and 2 Daves) Below is my working code and the IMultiValueConverter Clas...

WPF Two Way DataBinding - an Editable ComboBox to a DataView

<ComboBox Height="23" Margin="52,64,33,0" Name="comboBox1" IsSynchronizedWithCurrentItem="True" IsEditable="True" DisplayMemberPath="Value" SelectedItem="{Binding Path=Number, Mode=TwoWay}" /> public class Number : INotifyPropertyChanged { private strin...

Binding an Image in WPF ?

Hi, I wanna show an image in WPF that is created by a process, e.g : we have a method that is named createWPFImage() Image createWPFImage() { ... } So, the output of createWPFImage() is an Image. In the XAML code, we have a something like below : <StackPanel.ToolTip> <StackPanel Orientation="Horizontal"> <Image Width="64"...

Reassign textbox.text on bindingsource currentitem change event

I am just learning bindingsources etc. I have added my textbox databindings like so: txtTitle.DataBindings.Add("Text", bindingNavigator1.BindingSource.Current, "Title"); When the user clicks the next button on the navigator do I have to handle the bindingsource currentitem changed event to say txtTitle.Text = ((MyObject)bindingsourc...

How to bind xml to the WPF DataGrid correctly?

I have looked for and tried various solutions but so far none of them solve my problem. I am using the built-in DataGrid from WPF in Visual Studio 2010/.NET4 to display data from an XML document stored as an XDocument. My code all runs fine, and I have verified that the XDocument is present and correct. The DataGrid does not display any...

Cast Bindingsoure.Current to POCO

I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that. When I look at the type of Bindingsoure.Current its a DataRecordInternal. How can I cast that to my POCO? Will I have to manually work out which fields in the Current object relate to my POCO. I could do it through my POCO and just tak...

LoadedData accumulate results with related objects in Ria Services

Hello, I'm working with SL4 & .Net Ria Services. My datamodel has Devices with a 0..* property called DeviceAndStates, through this <riacontrol/> I get all Devices and his DevicesAndStates of a particular type. <riaControls:DomainDataSource Name="deviceDomainDataSource" QueryName="getDevicesWithOpenStateQuery" .../> In the client sid...

Databinding - setting default value

I have code like this, in pagefunction making up a wizard: <TextBox Name="txtDate" Text="{Binding Path=Date}"></TextBox> The user types in and clicks next, object sent to next page with this data. But if I set <TextBox Name="txtDate" Text="{Binding Path=Date, TargetNullValue='2010-01-15'}"></TextBox> So I can have some "example" t...

How to tell if user has modified data using bindingsource

I have a DataGridView bound to a bindingsource which is bound to a List<T>. The user clicks a row that goes to a form with textboxes etc. The textboxes are databound like so: if (txtID.DataBindings.Count == 0) txtID.DataBindings.Add("Text", bindingSource, "Title"); I want to be able to detect if the user has modified...

Make a TextBox sync with SelectedValue of a DropDownList

I have a FormView with the following ItemTemplate. What do I have to do to make the Textbox reflect the correct TypeName for the selected campaign? <asp:Label ID="campaignNameLabel" runat="server" AssociatedControlID="campaignList">Campaign Name: </asp:Label> <asp:DropDownList ID="campaignList" runat="server" Width="200px" AutoPostBac...

Binding textboxes to properties of a comboBox.SelectedItem

I'm using winforms and I've got a comboBox that represents an IQueryable. Below the combobox is a series of textboxes that I would like to be bound to the currently selected from the combo box. Here is my code. public partial class TestForm : Form { public DataClassesDataContext DataContext; public IQueryable<T> datasource;...

DevExpress LookUpEdit Behavior....

I'm tearing my hair off for this amazing problem. I'm binding 2 LookUpEdit from code: MyBinding.DataSource = typeof(MyObject); MyBinding.DataSource = _dataObject.GetMyList(); firstLookUp.DataBindings.Add("EditValue", MyBinding, "Code"); firstLookUp.Properties.DataSource = MyBinding; firstLoo...

Passing more than 1 argument to a converter

Question: How can you pass an instance of an object from the view model to a converter along with the value to be converted to a converter? Info: I'm working on an inventory program for people on our factory floor who receive incoming shipments. While receiving a shipment they will mark down who the shipping company was and who the dr...