binding

Force update of view on validation error using MVVM pattern

Hi! I have the problem: I have some controls on a form (a check-box, a combo-box, a slider, a text-box). Their values are bound to different properties of the view model. When a property of the view model has a certain value, I want these control to be "fixed" (a error message is displayed and they are set to some fixed value (e.g: the ...

Block binding in Ruby

Hi, I've been confused by the definition of block binding in ruby. Here are two samples: def redfine_a(&block) a = 2 puts eval("a", block.binding) block.call end a = "hello" puts redfine_a {a} This one could run with the expected result, while the second one: def redefine_a(&block) a= 2 puts eval("a", block.binding) block...

Can I stop a .Net BindingSource automatically navigating to a new record?

Using a BindingSource attached to an ObservableCollection I have a combobox displaying the items in the collection. Visual Studio automatically includes a BindingNavigator so I've enabled some features on that as well. Using the Add button to add a new item; the combobox automatically selects the new item. I assume this is because the Bi...

binding gridviewcolumn to string array

Hello Experts, having issues binding a gridviewcolumn to a string array (that probably sounds mad, but I can't seem to do this in the usual manner as I need to concatenate some xml results into one column cell). When I do the binding it simply hooks into the first string and ignores whatever else is generated into my array. The bit that ...

How can I implement this interaction model with jQuery?

With jQuery, I'm interested in creating the following interaction model. When a user types in the page, anytime jQuery notices three !, "!!!" typed in a row, to be able to do something about it. After noticing three !, "!!!", wrap the previous sentence (finding the last period from the location the user is currently typing and wrapping...

Programmatically bind property to GridViewColumn.Width

I got a WPF MVVM application containing a ListView containing a GridView. Using a helper class I'm creating the GridViewColumn's, which works nicely. My problem: I want to twoway-bind the width so I can read back changes to the width. The code to create the GridViewColumn right now looks like this: private static GridViewColumn Create...

Get Binding from a FrameworkElementFactory

In a GirdView the text of some columns sould be aligned to the right. To do that I create a DataTemplate, which contains a TextBlock. Binding bd = new Binding("path"); FrameworkElementFactory tbContent = new FrameworkElementFactory(typeof(TextBlock)); tbContent.SetBinding(TextBlock.TextProperty, bd); tbContent.SetValue(TextBlock.TextAl...

Silverlight - Can't get ListBox to bind to my ObservableCollection

I'm trying to make a ListBox that updates to the contents of an ObservableCollection whenever anything in that collection changes, so this is the code I've written for that: xaml: <ListBox x:Name="UserListTest" Height="300" Width="200" ItemsSource="listOfUsers"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock T...

How to bind to DataGrid in WPF

Hi I tried to understand but failed. In WinForms I can build up some rows in a datagridview. By using Application.DoEvents (not nice but works) I can see how it is building up also when the list is very huge. I just want some similar in WPF. Here is my project: http://www.goldengel.ch/temp/FileContent%20Replacer.zip I already posted...

How to bind a list of object to SpringMvc Controller?

I'm using the following action on a SpringMvc application: @RequestMapping(value = "/test", method = RequestMethod.GET) public ModelAndView test( @ModelAttribute List<Group> groups ) { //return whatever } My Group class has an 'id' and a 'name' property. Default getter/setter. How should i call this action in order to have this ...

BindingGroup with multiple (failing) ValidationRules

I ran into a problem today at work wherein I have a BindingGroup that has multiple ValidationRules that are failing simultaneously. Problem is, I get an ArgumentException bubbling up from withing BindingGroup.ValidateWithoutUpdate when I try and determine if there are any errors (i.e. to set the CanExecute on a command to false). I've m...

ASP.Net MVC maintain state of a dynamic list of checkboxes

I have a class called "PropertyFeature" which simply contains PropertyFeatureID and Description. It's a proper model created through LINQ to SQL mapped to an SQL Server database table. An example instance/row would be: PropertyFeatureID: 2 Description: "Swimming Pool" The number of rows (PropertyFeatures) can of course grow and shrink ...

WPF DataGrid with XmlDataProvider simple example

After a few hours trying to reach some working sample i decided to try my luck here. I am a newbie to WPF, but things should get easier with time ... I am trying to have a DataGrid showing an XML file i have. That's it. I have in my application cars.xml <cars> <car type="Ford" size="4" /> <car type="Mercedes" size="2" /> ...

How to pass an argument to event handler? python, tkinter programming

Hi friends., widget.bind('<Button-1>',callback) # binding def callback(self,event) #do something i need to pass an argument to callback() .the argument is a dictionary object. thanks in advance sag ...

How to assign dynamic value to an xml attribute in a resource tag?

I have a very simple demo project in here. In my code I need an xml resource. In the xml resource I need to set the attribute value to be a dynamic value such as read from configuration file ect... I tried binding but it seems like all text binding syntax are passed to the attribute. So, how can we bind/or work-around to have value set ...

How do I make a nasty C++ program scriptable with Python and/or Lua?

I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted ...

how to bind one function to other

I have a function A that accepts a predicate function as its argument. I have another function B and it takes a char and returns an int, and a function C that accepts int and returns a bool. My question is how to bind B and C to pass it to function A. Something like: A(bindfunc(B,C)) I know boost::bind works but i am looking for ...

Variable binding in Prolog

Hi all, I have written a predicate common_participant(Person, PairEvent). which returns pairs of facts from my knowledge base. I was wondering whether there is any way to perform variable binding and collect all results without using the semicolon every time. Thanks, I. ...

WPF simple binding problem

Hi Trying to understand this binding process of the WPF. See the code at the bottom. In my "viewmodel", see the code at the bottom, i have an observable collection that is populating the listview with the items. Thats the one that contains a path called symbol to set the selected index in the combobox. Now my problem is that i need to...

How to bind to a custom property in a Silverlight Custom control

I've created a custom control with, amongst others, the following: public partial class MyButton : UserControl { public bool Enabled { get { return (bool)GetValue(EnabledProperty); } set { SetValue(EnabledProperty, value); SomeOtherStuff(); } } } public static readonly DependencyProperty EnabledP...