databinding

How to use entitycollection for binding to wpf UI

I'm using EntityFramework for data access and wpf as UI. If I bind WPF components to navigation properties of my entity classes(usually EntityCollection<EntityClass>, exposed as IList<T> in service layer), UI is not updating the changes. I know i have to use ObservableCollection<T> or such, but I need some guidance on how to use it witho...

WPF TextBox won't update source

I'm trying to make a simple form that contains textboxes that draw from a db in my project. I'm using the table adapter's GetData() method in the xsd file to populate the data context. I want to update one of these textboxes and have the changes reflected in the database. The textboxes populate fine, but the changes don't make it back to...

c# binding to fields on a nested object

I can't seem to find a simple, concrete explanation of how to bind controls in a WinForms app to nested objects using data binding. For example: class MyObject : INotifyPropertyChanged { private string _Name; public string Name { get { return _Name; } set { _Name = value; OnPropertyChanged("Name"); } } private MyInner _Inn...

Flex4: Combo Box with CheckBox Inside.

Hi, Apologies for all the simple questions but they are born of my sudden and unplanned migration from flex 3 to flex 4. Ok I have a combo box which I would like to show a list of selectable check boxes. <s:ComboBox x="181" y="-7" width="233" id="dropISLIST" itemRenderer="IsListFilterCheckBox" dataProvider="{GetIsList.lastResult.Rep...

Can you use a CollectionViewSource inside a DataTemplate?

Is it possible to explicitly use a CollectionViewSource inside a data template? Normally we'd put the CollectionViewSource in the resources alongside the template, but our model doesn't allow that because the 'source' of the collectionviewsource is a property of the DataContext at this level in the tree, meaning there needs to be an ins...

Custom XML binding causes word doc to lose content control style/font

I am trying to do a word document that has content control bindings to an XML document that I am swapping out for custom.xml in the word docx package. When I created my original document, I added fonts and size and style to the content control text. This made it fit the rest of my documents style. Then when I swap in the custom XML con...

WPF bindings not refreshing

I have a listbox on my form that looks like this: <ListBox Name="lbResults" SelectionChanged="lbResults_SelectionChanged"/> I am binding the following collection to it: ObservableCollection<Hand> oHands = new ObservableCollection<Hand>(); using the following code: lbResults.DataContext = oHands; Binding binding = new Binding(); lb...

ASP.NET Repeater ItemCreated Event Binds the Same Item Over and Over

I have a Repeater on my page. There's nothing spectacular about it. <asp:Repeater runat="server" ID="rptBusiness"> <HeaderTemplate> <table> <colgroup> <col width="170px" /> <col width="75px" /> <col width="75px" /> </colgroup> <tr> ...

matching words in database conceptual definitions

I need to match the given words with their suitable meaning. Please help me as these words are very confusing to me.from " Unique identifier" to " Create-object operation", please find their meaning from a list given below. Problem 1 For each of the terms in the left-hand column below, select the term in the righthand column that best ...

WPF - Binding multiple values to a datagrind

UPDATED : Clean subject, and summarize it. Hi, I've a datable filled, where each cell is a class like this class CValue{ public object Value; public Brush Quality; private int m_quality; public override String toString(){ return Value.toString(); } } My datagrid is bind on the datable, and it's wo...

WPF TreeViewItem Header Value After DataBinding

Hi, I have a TreeView whose contents (nested TreeViewItems) are generated from a dataset via databinding, which all seems to work fine. The issue I'm running into is that when I try and manipulate the contents of the TreeViewItem headers in code, the Header property returns the DataRowView that the TreeViewItem was generated from and no...

WPF Binding a ListBox to an enum, displaying the Description Attribute.

Is it possible to use the ObjectDataProvider method to bind a ListBox to an enum, and style it somehow to display the Description attriibute? If so how would one go about doing this...? ...

WPF Optional Binding

I have an existing XAML file with some data templates in it. One of these datatemplate can be used in different situations. Therefore, I want to bind 1 of the properties only if a certain condition is true. What is the best way to achieve this? ...

SL ItemsControl, command on ViewModel not firing from ItemsControl (CheckBox)

Hi, I'm using PRISM v2, CAL, SL4 and MVVM and have a delegate command on my ViewModel called CheckCommand. The ItemsControl contains a checkbox and I'm trying to get the items in ItemsControl/Checkbox to fire this command when it's checked - but it's not communication back to the viewmodel! I think it's because each items 'datacontext' ...

Using JFace databinding with Hibernate: is this possible?

Our project is an Eclipse RCP application using Hibernate as an ORM. I recently learned about JFace databinding, in which the GUI and data models can be synchronized automagically. I put together a short test implementation along the lines of Lars Vogel's excellent JFace Data Binding Tutorial and was fairly impressed with the framework...

Conditional operator with DataBinder.Eval

I want to do something like this <%#(DataBinder.Eval(Container, "DataItem.Age").ToString()=="0") ?"n/a" :"DataBinder.Eval(Container, "DataItem.Age")"%> is it possible? ...

WPF - How to reuse listbox for display of different lists of objects?

Hey all, I have a ListBox which I am using to display the results of various searches. Those searches can occur on many different types of objects and I'm having a bit of trouble getting it to work in all circumstances. Most of the time I can just set ListBox.ItemSource = List and it's works fine if I also set the DisplayMemberPath an...

Problem with data binding in C#

I'm trying to understand better how data binding works in .net. I was checking this article, and I came up with this code: public partial class Form1 : Form//, INotifyPropertyChanged { public event PropertyChangedEventHandler MyTextChanged; [System.ComponentModel.Bindable(true)] public string MyText { get { retu...

How to switch UI Culture of data binding on the fly in Silverlight

I have a TextBlock control, which is data bound to DateTime property. The text displayed something like this: Thursday, October 21, 2010 I need to switch UI Culture on the fly, using something like this: Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInf...

Beyond Data Validation Styling: Styling based on other properties

I hope that this question has not been asked elsewhere, but I'm having difficulty finding the right search terms to bring up any already-existing answers to this problem. I'm implementing a program in C# WPF (MVVM) with many interview-style screens where the user inputs scientific data in an orderly manner. We would like to have the T...