databinding

Looping through WPF ListView DateTemplate Items

I have a ListView in a Windows Form that I bind a list of objects to on the creation of the form. What I would like to do is on a button click loop through the items that were created and change their IsEnabled property to false. I've tried two methods and neither were particularly successful. Can anyone help fix these up and/or sugge...

C# databindings, set not called

Hello, I got a combobox binded to a custom object. Most of the time the following code does not set the custom object (but from times to times it does). Do you have any clue on the issue ? //In the main form _person = new Person(); _citySelector.DataBindings.Add("SelectedCity", _person, "Adress.City"); //Adress is an object, city...

jQuery Core/Data or Custom Attributes(Data-Driven)

A similar question was asked here in storing information in a given html element. I'm still green to jQuery, but I'm looking for the best way to store information on the page. I have a Repeater that holds one image per item. These images are clickable and can fire a given jQuery event. The issue I'm having is, the objects that the Repea...

Why does GridView reset its values to what it was before user edits?

Hi If I bind GridView (via DataSourceID attribute) to SqlDataSource and set SelectCommand and UpdateCommand attributes, then everything works perfectly. But if we manually call GridView.DataBind inside *Page_Load()*, then SqlDataSource doesn’t perform any updates, even though SqlDataSource.Updating and SqlDataSource.Updated events d...

How to Decide Whether To DataBind a Control or Not?

What are some good guidelines to follow when deciding whether or not to databind a control (for example, bind a combobox to a List)? Are there situations where you should always or never databind a combobox? How do you decide? ...

Flex 3 not returning all the rows from JDBC

I am requesting rows back from JDBC, and binding the values in objects through Flex/BlazeDS into an arraycollection. If I ask twice in sucession, using the same function for the data, the second one invariably returns all the values,and binds them properly into an arraycollection. the first one doesn't return any rows, but doesnlt thro...

C# databinding on combobox

Hello, I can't understand the following 2 issues given this code. I mapped a combobox to a custom object and I want each time that the selected value change on the combobox, the custom object changes too. public partial class MainForm : Form { private Person _person; public MainForm() { InitializeComponent(); ...

WPF Binding to method of a collection element

Im searching for the best practice (or any working solution) for the following scenario: I have an Employee class: public class Employee { public string DisplayName { get; set; } // It is important that this method has a parameter public string GetSomething(string param) { return param + DisplayName; } } I have a...

Before Databinder.Eval

..there used to be another method of binding items to data containers in ASP.Net using 'ItemBinder' property maybe but nothing on google refreshes my memory. Typically, I would have a string array which when bound to say my DataGrid should show the array's values. This is an alternative method to DataBinder.Eval(). Thanks ...

How to make Databinding type safe and support refactoring

When I wish to bind a control to a property of my object, I have to provide the name of the property as a string. This is not very good because: If the property is removed or renamed, I don’t get a compiler warning. If a rename the property with a refactoring tool, it is likely the data binding will not be updated. I don’t get an er...

ASP.NET FormView: Including a Member Variable in an XPath Expression

Is something like this possible? <asp:FormView ID="myFormView" runat="server"> <ItemTemplate> <p><%# XPath("Root/Path/Item[@id=<%=this.m_myId%>]/HelloWorld")%></p> </ItemTemplate> </asp:FormView> m_myId is a member variable on the page. I can't seem to get it to work without a parsing error. ...

.Net Listbox DataBinding Problem

I have a main class which creates and populates a DataSet and an instance of this class is then passed to sub controls of my application by reference. I want to use this dataset to databind to components, in this case, a listbox. This is for a windows forms application. Heres what I'm trying: channelTypesLB.DataBindings.Add("Text", syn...

XAML bind to indexed element in property of binding

Given this object class Contact { public IEnumerable<Person> People { get; } public string PhoneNumber { get; } } class Person { public string MobileNumber { get; } } And the following layout <Contact> <PhoneNumber/> <SinglePerson.MobileNumber/> <People> <MobileNumber /> </People> <Contact> W...

How to bind control's two properties to two object properties properly

I have a Form with TextBox on it like this: Form f = new Form(); TextBox t = new TextBox (); t.Click += new EventHandler(t_Click); t.LostFocus += new EventHandler(t_LostFocus); Testus tt = new Testus(); t.DataBindings.Add("Left", Testus , "X"); t.DataBindings.Add("Text", Testus ,...

.Net DataView and DataTable Binding

I have a simple Windows Forms application which binds a DataView to a ListBox. This DataView uses Linq to sort my DataTable by a specific column descending. My ListBox is then bound to the DataView. I then have a simple form to add data to the DataTable. When I add a DataRow to the DataTable it displays in the ListBox. I'm curious as to...

DataTables and a Binding Source

I am trying to understand the difference between the following 2 examples. First, this is how I currently assign Data to a control in my WinForm App. lkuCounty.Properties.DataSource = Person.CountyList(); lkuCounty.Properties.PopulateColumns(); lkuCounty.Properties.DisplayMember = "CountyName"; lkuC...

Is Databinding a good way to connect a view to a model

I am thinking about the design of a WPF or Silverlight application. I am planning to use MVC (or another such design pattern) Witch ever of the design patterns I choose, I need to connect to view to the model (or presenter) – is databinding a good way of doing this? (In the past with WinForms applications I have found that Databinding...

Databinding to the properties of an object that implements IEnumerable

I am trying to do simple data binding to an instance of an object. Something like this: public class Foo : INotifyPropertyChanged { private int bar; public int Bar { /* snip code to get, set, and fire event */ } public event PropertyChangedEventHandler PropertyChanged; } // Code from main form public Form1() { Initiali...

Multiple Sources(DataTables) in ONE BindingSource?

This question may reveal my ignorance as a Programmer but I won't know if I don't ask. The BLL/DAL I inherited returns DataTables for everything. Address, Phone, CountyList, StateList, etc... My issue is that on a Given page, say Member, there is multiple DataTables being pulled down but the page gets updated as One. Is there a...

When does WPF subscribe to the PropertyChanged event?

I have a ClassA with an ObservableCollection Property, that implements the INotifyPropertyChanged interface on my window codebehind I have declared a ClassA variable, and initialize it in the Main() method. i'd expect that variable.PropertyChanged would have a WPF event wired to it, but apparently the PropertyChanged event remains null...