binding

WPF Binding to properties of an object with specific attributes

I have a listbox to which I have bound the data context to an object. This object has a number of properties some of which will have a particular attribute. What I want to do from this is to have the items source set to the properties of the object but to only display those properties that have a particular attribute set. Can anyone he...

Binding: WPF vs WinForms

As far as I know, INotifyPropertyChanges was "invented" before WPF. Could someone please explain what is new in WPF that allowed to do different kinds of binding properties of the control to the properties of objects. Either this was also available in the WinForms but wasn't so popular due to some reasons? (if yes, what is that reasons)...

Dependent Comboboxes overwriting Data

I have a really weird situation with dependent comboboxes and I am about to pull my hair out!! I have 3 Comboboxes that display data from the selected item in a listview for editing. The DataContext for the UserControl is the Same as the Listbox. When I go select different items on the listbox the data in the 2nd and 3rd combo gets r...

Does Visibility = IsCollapsed skip the data-binding part?

If I set a StackPanel or what ever bound area I have as 'Collapsed', does the data load? Will it trigger its Loaded event? ...

How to bind objects list to infragistics data grid?

Pretty simple task, but the source code doesn't do required job... Please advise. There is Products collection in the class (approach is based on the MVVm pattern, but that is not influe on the current issue): public class ProductWindowViewModel : WorkspaceViewModel // implements INotifyPropertyChanged { public ProductWindowViewMod...

Binding linq result to list box

Hi , i have the following piece of code, that for some reason that i'm unaware of, doesn't populate the LINQ resultset to the listbox (and there are many results in this list), however, i bind it to the original datatable, it works well. any ideas: DataTable t = _partitionsDataSet.Tables[0]; var customizedPartitions = ...

binding a collection to a setter method of a domain class in grails

I have a domain object with a setter method that takes in a map of id, value pairs. This is not just a plain association, and this setter method has some login in it. For example: class DomainObj{ def setTheMap(map){ //do stuff with the map } } I have a form where the user can type in a value for each id. My goal is that when ...

Binding a jQuery click event to each element within a foreach loop

I am building a plugin which matches an element, finds a link within it and makes the parent element go to that location upon a click. I have a loop in the main body: return this.each(function(options) { $to_link = $(this); //matched object link_href = $('a', $to_link).attr('href'); //link location $($to_link,$parent)...

Winforms - a strange problem a with simple binding

Hi Guys, It's hard for me to clearly describe my problem but I'll try. I have a UserControl1 which contains UserControl2 which contains several WinForms controls (most of them DevExpress). I do simple binding to these controls to my datatable fields. So far everything works fine. When I move the focus to a record in the table (by naviga...

WPF command canExecute method isn't firing

Hi I have the following listbox template within a WPF Page I want the search button to only be enabled when a checkbox in the listbox has been checked. I am using the MVVM and have a seperate commands class Unfortunately the Canexecute method for my Search button is not being fired Mycommand is defined as public static readonly Rou...

Having an issue with CoverterParameter Binding in silverlight

Hi everyone, I am having an issue with the xaml parser not liking my binding statement but i cannot see anything wrong with the statement. Invalid attribute value {Binding VehicleSpeed, ConverterParameter={Binding InMiles}, Converter={StaticResource SpeedConverter}, Mode=TwoWay} for property DataMemberBinding VehicleSpeed and InMi...

How to write a wrapper over functions and member functions that executes some code before and after the wrapped function?

I'm trying to write some wrapper class or function that allows me to execute some code before and after the wrapped function. float foo(int x, float y) { return x * y; } BOOST_PYTHON_MODULE(test) { boost::python::def("foo", <somehow wrap "&foo">); } Ideally, the wrapper should be generic, working for functions and member fun...

WPF TreeView bound to ObservableCollection not updating root nodes

Sorry - my question is almost identical to this one but since it didn't receive a viable answer, I am hoping that someone else has some fresh ideas. I have a WPF TreeView that is bound to a hierarchy of a single type: public class Entity { public string Title { get; set; } public ObservableCollection<Entity> Children { get; set...

Any way to reuse Bindings in WPF?

I'm getting to the point in a WPF application where all of the bindings on my controls are getting quite repetitive and also a little too verbose. Also if I want to change this binding I would have to change it in various places instead of just one. Is there any way to write the source part of the binding once such as in a resource and...

Binding to the selected item in an ItemsControl

I created a custom ComboBox as follows: (note, code is not correct but you should get the general idea.) The ComboBox contains 2 dependency properties which matter: TitleText and DescriptionText. <Grid> <TextBlock x:Name="Title"/> <Grid x:Name="CBG"> <ToggleButton/> <ContentPresenter/> <Popup/> </Grid> </Grid> I want...

Flex binding in AS3 - Negate boolean value

I am binding a checkbox to a property on a control. Everything is fine, but I need to bind the checkbox to another property, and the value needs to be the opposite of chkbox.checked. BindingUtils.bindProperty(obj, "propertyBool", checkBox, "selected"); I need something like this... BindingUtils.bindProperty(obj, "propertyBool", chec...

WPF - Binding to current item from within group header style

Hi, I'm something of a WPF noob so please take it easy on me ;-) I am trying to create a grouped DataGrid (WPF toolkit version). I have successfully created the data source, the DataGrid itself, the required CollectionViewSource and the Style for the group header (which uses an expander). I want to group by a property called 'Assign...

What is the XAML equivalent for binding SelectedIndexProperty in .cs .net silverlight code?

I have been playing with bindings in silverlight, and have figured out how to bind in code, but would prefer to keep the binding in the XAML. This is the code that works in my .cs file: System.Windows.Data.Binding IDBinding = new System.Windows.Data.Binding("ID"); IDBinding.Source = MyTrans; IDBinding.Mode = S...

Dynamic Binding in WPF DataGridCell Template

I have a question about data binding DataGrid in WPF. I am using the VS 2010 Beta 2 which has its own DataGrid, not the Toolkit one, although I think it is pretty much the same. I want to bind to a dataset which has 52 columns, one for every week of the year. For this reason I want to bind the data dynamically rather than specifying eac...

WPF Binding Problem - Does not work!?!

Hi there, I want to bind some properties from my code-behind .xaml.cs to some xaml-code, just like this: <TextBlock [someProperties] ... Text="{Binding ElementName=awesome, Path=value}" /> <TextBlock [someProperties] ... Text="{Binding Path=legendary}" /> In the associated .xaml.cs file I have the property: public String legendary =...