binding

WPF Binding to ElementName inside ItemsControl

I have a checkbox, and an ItemsControl populating several DataGrids the following way: <Checkbox Content="Birthday Column Visible" x:Name="UI_BirthdayVisibleCB" /> <ItemsControl ItemsSource="{Binding Path=ParentsCollection}"> <ItemsControl.ItemTemplate> <DataTemplate> <DataGrid AutoGenerateColumns="False" ItemsSourc...

wpf - ListBox - bind SelectedItem to an xml attribute?

I have a listbox on a usercontrol which is populated by a xml file. <Machines xmlns=""> <Machine Name="Prod1" IP="192.168.1.200" isDefault="true" InstanceName="sql08" /> <Machine Name="Prod2" IP="192.168.1.101" /> <Machine Name="Test1" IP="192.168.1.103" /> <Machine Name="Test2" IP="192.168.1.104" /> </Machines> I would like t...

How to programatically configure binding to force JSON encoding of WCF messages?

I'm creating a custom binding (mostly for diagnostic purposes initially) that programatically changes thw way WCF messages are encoded. Here's what it looks like: public class ConfigurableNetTcpBinding : Binding { public enum MessageEncoding { Text, Binary, MTOM, ByteStream, JSON, }; ...

wpf twoway binding and update from code-behind...

Hi, I've ToggleButton defined like this in XAML: <ToggleButton IsChecked="{Binding DateFilter, ElementName=myUserControl, Mode=TwoWay}"/> and 'DateFilter' defined like this: public Boolean DateFilter { get; set; } When I click the toggle-button, 'DateFilter' updates accordingly. BUT, if I modify 'DateFilter' in code, the ToggleB...

Bind to a property

I have an object(class): Foo. It has a property: Bar. What should I do to be able to Bind to that 'Bar' property? (WPF, .NET 4) EDIT: TO be more explicit, I give an example: I have a Dot:UserControl I create 2 properties of Dot - CenterX and CenterY: public double CenterX { get { return Canv...

WPF Custom ICommand implementation and the CanExecuteChanged event

Hi, in my WPF UI, I use RoutedCommands that I refer to in my xaml via the following code: Command="viewModel:MessageListViewModel.DeleteMessagesCommand" I don't like this static link to my ViewModel class,I think this is not as nice as creating a custom ICommand implementation and use a syntax like the following Command="{Binding De...

.NET 4.0 Late Binding: Ensure Assembly Authenticity?

Hello, I have to develop a .NET C# application that supports plugins. I’ve found a lot of information on the internet and it doesn’t seem to be so hard. I just have a specification that the Assemblies of the modules must be validated on the assembly level. When the late binding occurs and the assembly loads, the host application must b...

coldfusion - bind a form to the database

Hi, I have a large table which inserts data into the database. The problem is when the user edits the table I have to: run the query use lots of lines like value="<cfoutput>getData.firstname#</cfoutput> in the input boxes. Is there a way to bind the form input boxes to the database via a cfc or cfm file? Many Thanks, R ...

WPF MVVM Button Control Binding in DataTemplate

I've seen other questions that deal with this, but never any explicit code describing the fix. I can't get a button inside of my ItemTemplate to bind to ANY command anywhere. Very frustrating. I am a complete MVVM newbie, btw. Here's my Window XAML. <Window x:Class="RET.CMS.Printing.App.MainWindow" xmlns="http://schemas.microsoft.c...

How do you bind a data field value to a combobox index?

This may have been already asked but I can't seem to find this specific question, so here goes... I have a form in C# where every textbox is bound to a field in a row. Rows can be cycled through by some buttons on the bottom but all the data displayed at a time in the from is from one row. Any changes that are made get updated back to...

jquery bind submit event - find caller

Hi, How would I be able to find out the caller/sender of an event on binding. $(this).bind("submit", function(caller) { ... }); I found out that I could use "caller.originalEvent.explicitOriginalTarget", but this only works in firefox. EDIT: I'm using the jquery validation library from position-relative.net I want to make it so tha...

display bounded property in a design time

Hello, I am solving the following problem. I have a textfield with binding and I would like to display the bounded source property as a text while being in design time mode. Couldnt find any example I have no idea how to access binding properties of a current component. For example class TextField extend JTextField{ private String te...

Custom formatting mvc grid

Who could tell me why this formatting doesn't work in case of Ajax Binding? .RowAction(row => { if (row.DataItem.Probability == 100) row.HtmlAttributes["style"] = "color:green;"; }) ...

ASP.NET MVC - Insert or Update view with IEnumerable model

I've seen plenty of examples (NerdDinner, Sanderson's Sports Store, etc.) where a view is bound to a collection of objects. The syntax in the view is usually something like this... <%@ Page... Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyViewModel>>" %> ... <% foreach (var myViewModel in Model) { %> I've also seen plenty of exampl...

WPF ComboBox does not show current item when it is a DependencyObject

I have this very simple Combobox in my XAML: <ComboBox Name="cmb1" Width="200" Height="23" ItemsSource="{Binding}" /> and this is my code behind: public class Test //: System.Windows.DependencyObject { public string Name { get; set; } public override string ToString() { return Name; } } public MainWindow() { InitializeC...

Bindings inside CompositeCollection

I want to create a TabControl with a number of "static" TabItems (explicitly typed in XAML) and a number of dynamically added TabItems. To achieve this I tried to use a CompositeCollection as the TabControl.ItemSource. Sample code: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/...

WPF DataGrid binding not working

Hi, I cannot get DataGrid binding to work in the example bellow. Any clues on what's going on ? namespace WPFTestApplication { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public class Person { public int age { get; set; } ...

WPF: EmptyListToVisibilityConverter

Hi, I'm trying to do an "empty list to visibility converter" for WPF. This is an IValueConverter that takes an object ( that should be a list ) and if the list is empty (or if the passed object is null ) it should return Visibility.Collapsed; if the list is not empty it should return Visibility.Visibile; I plan to use this for a datagr...

wpf apply staticresouce based upon data

How can I apply a static resource by name based upon data? I know that I can write a data trigger for styling properties, but I want to apply an entire style based upon bound data. Ex: if (condition) CellValuePresenterStyle="{StaticResource OptionalFieldCellPresenter}" else CellValuePresenterStyle="{StaticResource RequiredFieldCellPres...

Binding to HTML elements in GWT

I'm trying to figure out how to bind a javascript event to a select element in GWT, however the select element isn't being built in GWT, but comes from HTML that I'm scraping from another site (a report site from a different department). First, a bit more detail: I'm using GWT and on load, I make an ajax call to get some HTML which incl...