databinding

Broken binding with Prism, Silverlight and ViewFirst approach.

The problem we are having is that we cannot get binding to work in our prism silverlight application when using the view-model first approach. The view first approach work fine. We have gone over the official documentation and various web sites, but have still not resolved the issue. Below is the code for both the view-model first, and t...

How to make an existing object a data source in Microsoft Expression Bend 3?

This example is just for learning ... I have started a project in Visual Studio C#. It is very simple, there is a Phone class which is instantiated in the code behind. I would like to add the GUI using Blend 3. public class Phone:DependencyObject { public string PhoneMake { get { return (string)GetValue(PhoneMak...

Can I page through grouped data in DataGridView?

I have a simple VB.NET 2008 app that helps users to edit fields in the database. Simple enough as a first "real" project in .NET, right? For one table, I am currently using a DataGridView so it can be edited straight up. However, instead of offering the user the entire table, I'd like to group the data by the 'CompanyNumber' column and ...

Databinding problems with postback

Hey, I've two issues currently preventing me from finishing two projects properly. I'll put them both here as I believe they're connected to the asp.net page lifecycle, but I can't find a way around them. First I have a DropDownList which I must sort in codebehind. It only contains text, so I should be able to do that with the followin...

What should I return from LINQ To SQL for DataGridViews

I have a WinForm App that uses multiple DataGridViews. The DGV's used to be bound to DataTables in the old SProc's DAL. As I was converting the SProcs to LINQ I originally was following suite but I am wondering if that is the "best" way. This is a sample of what I am doing. internal static CmoDataContext context = new CmoData...

Linq to SQL Design question

Often I need to combine data from multiple tables and display the result in a GridView control. I can write a Linq query inline in the Page_load event, return an anonymous type that combines all the fields that I need, and databind the result to the GridView control. Problem: I use 'helper methods' as described by Scott Guthrie on hi...

Autofill in the Gridview --> Itemtemplate --> Text Box or Dropdown

Hi, I have a following requirement. ASP.net GridView control has following fields. HeaderTemplate ID ------ Name---------- Model dropdown[ ALL-Yes ] --------Description. Item template label------ label ----------Dropdown ------------------------- Text box ID and Name field bound to datasource and populated from databas...

How should I set an image index of an ImageListBox item in a databinding scenario?

I have a Document object that looks like this: public class Document { public Title { get; set; } public Extension { get; set; } public byte[] Data { get; set; } } The Extension is "pdf", "doc", "docx" and the like. This document is used for storing documents in a database (it's actually a DevExpress XPO object). The prob...

DataBinding the AJAX Control Toolkit's Rating Control

I'm attempting to use the AJAX Control Toolkit's Rating control in a DataBinding scenario. I have a ReuseRating column in my database that is a tinyint. It can hold values 1 through 5. Every record in the table has the value set to 1 currently. If I do this in my ItemTemplate everything works fine. I get 1 star filled in on my rating ...

get object out of telerik radcontrol for winforms binding

Hello, I hope that someone can help me with an issue related to binding a bindable collection class to one of the Winforms Telerik list controls. If you bind to a plain ole windows list control like this... dim list as new listBox with list .DataSource=myCollectionClass 'this contains a collection of widgets. .ValueMember=...

Wpf Data Binding using IMultiValueConverter and casting errors

As part of learning WPF I just finished working through an MS Lab Exercise called "Using Data Binding in WPF" (http://windowsclient.net/downloads/folders/hands-on-labs/entry3729.aspx). To illustrate using an IMultiValueConverter, there is a pre-coded implementation of one where the boolean result is used to determine whether the data bi...

Silverlight VirtualizingPanel recycling containers display wrong content

I recently wrote an implementation of a VirtualizingWrapPanel that recycles containers as they scroll into and out of view. On occasion I've noticed that the content rendered by the control is actually the previously contained data, not the current data. Performing any action on the control that forces a new render call updates the cont...

wpf databinding testing

I'm in the process of learning WPF, where one of the strong suits is supposed to be data binding. When I do a win forms app, because I don't trust data binding much, I use what Fowler would call an assembler and just do it by hand, which makes it easy to test also. I've read Jeremy Miller's blog enough to see he has issues with data bin...

WPF ComboBox binding behaviour

I have the following XAML markup: <TextBox x:Name="MyTextBox" Text="{Binding Path=SelectedCustomer.FavouriteProduct.ProductNumber, UpdateSourceTrigger=PropertyChanged}" /> <ComboBox x:Name="MyComboBox" ItemsSource="{Binding Products}" DisplayMemberPath="ProductName" SelectedValue="{Binding Path=SelectedCustomer.FavouriteProduct.Prod...

Binding to AssemblyVersion in XAML (for Help/About dialogue)

Maybe I'm expecting too much here, but I figure I can't be the first person to have tried. Do I have to create (yet another) converter for this? ...

WPF Databinding and Styles with MVVM

I have a problem with databinding on a style in WPF. The basic setup looks like this: <Style x:Key="{x:Type eo:Player}" TargetType="{x:Type eo:Player}"> <Style.Triggers> <DataTrigger Binding="{Binding Team}" Value="A"> <Setter Property="Template" Value="{StaticResource TeamATemplate}"></Setter> </DataTrigger> ...

C#/WPF: Bind ComboBox to two Elements?

Hello, I've following objects public int PersonAge { get; set; } public List<PersonGroup> PersonList { get; set; } public class PersonGroup() { public string Name { get; set; } public string DefaultAge { get; set; } } My ComboBox is bound to PersonList, while I also have a TextBox which is bound to PersonAge. If a user ente...

How to save an entity without saving an associated entity used as a lookup for a WinForms combobox

When I try to save a new Order, the entity framework (.NET Framework 3.5 SP1) attempts to insert a new Status row into the database in addition inserting to a new Order row. I do not want to insert a new status row. I only want to insert an Order row to the database. I have the following tables (and columns) with 1-1 entity mappings: ...

WPF: Bind ListView with Multiple Sources

Calling all WPF experts! I'm converting an application I made to create characters for a particular RPG from Window Forms to WPF. For the most part, the program is much simpler in its WPF form; however, I can't seem to figure this part out for the life of me. I have a database that contains a list of skills that the character can take....

Bound Property always returns false but WPF bound CheckBox is still checked.

I have a checkbox in a UserControl: <CheckBox Content="Existing" IsChecked="{Binding Path=IsExistingTemplate, Mode=TwoWay}"/> It is bound to a DataContext with Property IsExistingTemplate which always returns False. (In my real application, it doesn't always return False!). DataContext implements INotifyPropertyChanged. ...