databinding

CheckboxList - Use web.config value in text field

Hi there, The scenario I'm dealing with is I have a set of entries in a database that have an image associated with them. This image needs to be 'accepted' or 'rejected' via a web interface. I'm using ASP.NET WebForms. I'm attempting to databind my recordset of entires to a CheckBoxList control. I would like to combine data from my da...

Is there a performance hit for a Silverlight application while implementing MVVM pattern using Databinding?

Hi, I am implementing the Model-View-ViewModel (MVVM) pattern in one of the forms of my SL2 appication using INotifyPropertyChanged interface and TwoWay Databinding. However I feel that due to this approach, my form behaves slightly sluggishly. I just wanted to know whether using this approach is there any performance hit in such SL...

Refreshing UI with databind in WPF

I have a 3 layer deep treeview, -MAIN ->:SUB1 >:SUB2 >:SUB2 -X:SUB1 X:SUB2 SUB1 SUB1 where, > and X represent graphics denoting the status of that specific item (determined from backend). I'm using an Observable Dictionary to bind to this tree (and it has an ICollectionChanged event). The structure is like this: Obse...

Different Value Member, same control

Edit 1 I believe my problem stems from the following. The function that fills the dropdown portion sets the Display Member to the CountyName. Then when I try and set the SelectedText or EditValue, as has been suggested, that function only returns the CountyID which it try's to match to something in the DropDown list DisplayMember. I ...

Databinding to a heterogeneous list

I have a WPF UserControl with a ListBox and ContentPanel. The ListBox is bound to a ObservableCollection that has apples and oranges in it. What is considered the proper way to have it setup so if I select an apple I see an AppleEditor on the right and if I select an orange an OrangeEditor shows up in the content panel? ...

WPF ListBox not updating with the ItemsSource

I have what I believe should be simple two-way databinding in WPF setup, but the listbox (target) is not updating as the collection changes. I'm setting this ItemsSource of the ListBox programmatically: lstVariable_Selected.ItemsSource = m_VariableList; And the ListBox is declared as follows: <ListBox Margin="5" Name=...

How do I bind a Combo so the displaymember is concat of 2 fields of source datatable?

Id like to bind a combo to a datatable (which I cannot alter ito it original schema) cbo.DataSource = tbldata; cbo.DataTextField = "Name"; cbo.DataValueField = "GUID"; cbo.DataBind(); What I want to do, is have the combo textfield show tbldata.Name column + tbldata.Surname. Of course adding the new name+surname as a field to the tbld...

Get Data from ObjectDataProvider when combo box opens

How do I go about getting an ObjectDataProvider to get triggered each time a combo box is expanded instead of just one time? <UserControl.Resources> <ObjectDataProvider x:Key="possibleExpressionValues" MethodName="GetWatchVariableNames" ObjectType="{x:Type mu:UserInterfaceHelper}" IsInitialLoadEnabled...

ObservableCollection Databinding performance

I would like to know why according to this article and observable collection binds significantly faster(20 ms vs 1685ms, that's 800X faster) than a List<> collection in WPF. I looked at the internals of ObservableCollection and it uses a List as it's storage collection object(I used reflector and saw this in the constructor) public Coll...

Winforms .net 2.0: binding a textbox to a parent property

Hey All, I've got a strongly typed dset, w/two datatables: Parent and Child, w/a relation linking them in the way you'd expect (e.g. parent-has-many-children). On my Child Detail form, I show lots of info on the current child, w/binding calls like so: me.txtBirthDate.DataBindings.add(New Windows.Forms.Binding("Text", MyDataset, "Child...

Different data contexts in a SL3 form

I wrote a custom Silverlight 3 control that uses a class as its data context (MVVM pattern). I want to place this control on another control (form) through XAML. The child control exposes a Dependency Property that when set through XAML, will make it show detailed info. So an example is that the child control shows order details data, ...

How can I avoid recursion when updating my ViewModel properties?

In my View I have a slider and a combobox. When I change the slider, I want the combobox to change. When I change the combobox, I want the slider to change. I can udpate one or the other, but if I try to update both I get a StackOverflow error since one property keeps updating the other in an infinite loop. I've tried putting in a Re...

WPF Databinding CheckBox.IsChecked

How would I bind the IsChecked member of a CheckBox to a member variable in my form? (I realize I can access it directly, but I am trying to learn about databinding and WPF) Below is my failed attempt to get this working. XAML: <Window x:Class="MyProject.Form1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:...

ElementName Binding from MenuItem in ContextMenu

Has anybody else noticed that Bindings with ElementName do not resolve correctly for MenuItem objects that are contained within ContextMenu objects? Check out this sample: <Window x:Class="EmptyWPF.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

Binding arraylist to grid view (Part whatever....)

Ok, I'me getting real dumb with this one.... I have this class: Public Class whatever Public id as string Public name as string public date as string end class Wich I use with this code: dim personlist as new arraylist dim person as new whatever person.id="1" person.name="bozo" person.date="6-6-6" personlist.add(person) and then ...

WPF Composite Controls

I'm trying to create a reusable UserControl in WPF that has a Label and a TextBox. I want to add properties to my UserControl to bubble up the Text fields of both child controls up to the parent for easy binding. I read that I need to a little bit of hocus pocus by adding owners to DependencyProperties. Here is my code now. It seems ...

Winforms ComboBox Databind with DropDownStyle=Dropdown

Winforms / .Net 3.5 I am using a combobox with the dropdownstyle set to dropdown (allows users to enter data). The problem I am having is with how to setup the combobox so it updates my bindingsource with values from the list and also when a user enters data. For example the combobox may contain the following values: "Red", "White",...

access-like data navigation in WPF?!

What would be the best way to build a data-navigation like in access-forms in XAML/C#? Should I build a user control (or even custom control) that I just bind to my collection in which I can put other controls? (hence this question: http://stackoverflow.com/questions/969835/c-user-control-that-can-contain-other-controls-when-using-it ) ...

How to Bind an XmlDataProvider Class Property to a XAML TreeView

I would like to bind a TreeView control I have defined in XAML to a property in its code-behind class. I already read through a WPF Basic Data Binding FAQ, but the example in the comments at the very bottom of the page didn't work when I tried to use an XmlDataProvider as the binding source. How can I modify the following code so that t...

Limit the number of results on a ASP.NET ListView

I have a ListView bound to a Generic List collection. I need to be able to limit the number of items bound to something like 5, and show a more button in the template. I can handle the DataBinding event, and remove the last few items in the List<>, but something about that doesn't feel right. I also can't limit the list to 5 beforehan...