databinding

DataBindingComplete is getting called multiple times

Hi, I am creating a windows application in c#, I have 1 Datagridview and after I set it's DataSource it should have 3 Rows. I have attached 2 Event Habdlers to the Datagrdview void dgvProductList_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)<br> { //this gets called 4 times } private void dgvProductList_DataBinding...

VS2008 Two way Data Binding: how to get it to work?

I'm a bit stuck playing with DataBinding in a tryout project. I have a simple form with just a spinbox, which I want to bind to a member of the form. class Form1 { public class Data : System.ComponentModel.INotifyPropertyChanged { int _value = 10; public int value {get;set;} public event System.ComponentMode...

WPF - Dynamic tooltip

I have a class ToolTipProvider which has a method string GetToolTip(UIElement element) which will return a specific tooltip for the UIElement specified, based on various factors including properties of the UIElement itself and also looking up into documentation which can be changed dynamically. It will also probably run in a thread ...

Issue with UPDATING Databse after deletion of someting !

I'm working on basic sql, using C# with binding options and adapters. I have sucessfully added data to my database and can then update with no problems. But when I try to delete some data and then UPDATE it throws an exception: An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll Additional...

WPF Databinding Beginner question

I'm new to the whole WPF programming, but have been doing Windows Forms programming for a while. Anyway, I have a button that when clicked will run a stored procedure on a SQL Server and display the resulting data in a grid within the same window. In windows forms world, I'd create a datatable, use a dataadapter to fill it and then ass...

DataBind and Postback

This is a general how does DataBind work questions... I have a simple page with a GridView that is bound (in the aspx code) to an ObjectDataSource. I can look in the Select() function called by the ObjectDataSource to see that it is called on the initial load and on every post back. I have some logic that happens on post backs that wi...

How to change data display in a TextBox from a DropDownList selection?

Hi guys as the subject i posted. I really need to know, how to get result from DDL that can automatically changes the display in the TextBox. Our each item has got more than one size and sometimes the price will be different when you click on a different size. How can I implement this function? Any help, I would appreciated. Here is my...

How can I create a DataTemplate with Expression Blend 3?

I'm currently experimenting with Expression Blend 3 MIX09 version with the idea to use it primarily for an MVVM structured site with databinding, being able to view live data as I design. So far I've been very impressed and have to say that Blend 3's generated XAML is not as bad as people say it is. I got the following two examples worki...

How to have two values for a column in grid

Hi, We are using AspXGridView devXgrid for our web application. I have to assign two values (id,value) for a column in the grid. How can I do this? Thanks, P.Gopalakrishnan. ...

Can I use XAML to set a nested property (property of the value of a property) of a control ?

I've got a WPF Control that exposes one of it's children (from it's ControlTemplate) through a read-only property. At the moment it's just a CLR property, but I don't think that makes any difference. I want to be able to set one of the properties on the child control from the XAML where I'm instantiating the main control. (Actually, I w...

How to keep datasource updated in all WPF user controls?

I have WPF application with one main window. In this window there are a series of buttons which form a menu and a space where user controls are loaded at runtime. However, if the user changes data (stored in XML file) in one user control and then switches to another user control, the user does not see the updated data in the new user c...

What am i missing... windows forms binding with subsonic

I have a form with a list box and a few text boxes, when the user selects an item from the list box, i need the approptiate information to show up in the txt boxes and allow the user to edit it. Here's my form Load event: Private prt As New DataAccess.Part Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArg...

how to deal with complex winform object databinding?

Hi, What are the best practices or tips with respect to data binding to objects? I have a complex data binding scenario where my winform has a BindingSource set to an object. This object is a class of type Customer and the forms are bound the customer's properties like "firstName", "lastName", etc. Each property has the following pat...

WPF Data Binding to changing object

Hi, I have a user control which displays the currently logged in user's name. I have bound a TextBlock in the control to the UserId property of a User obejct in my application. The issue I have is that the User object my binding has as a source changes each time a new user logs in. I can think of a solution where I fire an event when ...

WPF - Bind image property to Image control

Suppose I have string Name and Image Photo as properties of a class in my DataContext. I need to bind them to controls is a DataTemplate. I thought this would work but it doesn't: <Image Source="{Binding Photo}"/> Why not? Should I my Photo have another type? (BitmapImage perhaps?) How can I bind an Image control to an Image proper...

WPF: Display a bool value as "Yes" / "No"

I have a bool value that I need to display as "Yes" or "No" in a TextBlock. I am trying to do this with a StringFormat, but my StringFormat is ignored and the TextBlock displays "True" or "False". <TextBlock Text="{Binding Path=MyBoolValue, StringFormat='{}{0:Yes;;No}'}" /> Is there something wrong with my syntax, or is this type of ...

Setting up an ObjectDataProvider

I'm having some trouble with setting up an ObjectDataProvider with custom method parameters. For a start I have a ListBox which is bound to a custom List which is set up programmatically with ItemsSource property. Then i would like to SelectedItem to be a parameter to my custom method. So in XAML i have: <ListBox /*omitted*/ Selection...

MVVM and window lists

I'm writing an app that lets users browse through data, and I want to use the FireFox UI style: allow the user to open as many windows as they want, each with as many tabs as they want. I also want to try to do this using the Model-View-ViewModel pattern as much as possible. Opening a new tab should be easy enough to handle in MVVM. Mak...

WPF: Adding an element to a databound Collection (a Dependency Property)

I have this DependencyProperty which holds an entity with a property that is a collection (ShoutBox.Entities): public static readonly DependencyProperty ShoutBoxProperty = DependencyProperty.Register("ShoutBox",typeof (ShoutBox),typeof (ShoutBoxViewerControl)); public ShoutBox ShoutBox { get { return (ShoutBox) GetValue(ShoutBoxPro...

ASP.NET repeater alternate row highlighting without full blown <alternatingitemtemplate/>

I'm trying to accomplish simply adding a css class to a div on alternate rows in my <itemtemplate/> without going to the overhead of including a full blown <alternatingitemtemplate/> which will force me to keep a lot of markup in sync in the future. I've seen a solution such as http://blog.net-tutorials.com/2009/04/02/how-to-alternate-r...