databinding

DataStateBehavior for Enum instead of bool? String?

Is there an easy way in WPF to bind VisualStates to enum values? Kinda like DataStateBehavior, but for an Enum? ...

When is it worth using a BindingSource?

I think I understand well enough what the BindingSource class does - i.e. provide a layer of indirection between a data source and a UI control. It implements the IBindingList interface and therefore also provides support for sorting. And I've used it frequently enough, without too many problems. But I'm wondering if I use it more often ...

Binding a collection in silverlight

For example, I have a collection of integers 1 - 10. I want to dynamically display 4 (can be 5, 6, 7) columns in the datagrid in silverlight. How can I bind the collection to the datagrid to achieve the following? C1 C2 C3 C4 R1 1 2 3 4 R2 5 6 7 8 R3 9 10 Cheers ...

ASP.NET 4 AJAX databinding help

Can some one provide step by step tutorial how to do ASP.NET 4 AJAX data binding ...

asp.net disappearing data from Dropdownlist inside listview when loading from DataTable

Hello I have a problem with dropdowllist ddl1 that is inside of insertitem of listview. I populate it from table on page load. In Page_load I have: if (!Page.IsPostBack) { ListView1.DataBind(); InsDropDownList3.DataSource = GetAllPlayersName(); InsDropDownList3.DataBind(); } DropDownList ddl1 = (...

asp.net listview showing data from related entity and changing it

Hello, I am using entity framework. My model has entity tblGameInfo where in navigation properties are associations called tblPlayer1 and tblPlayer2 which links to entity tblPlayer. I have listview on my page where I want to show game info with players names. I have found that in of listview I should have e.g. one of those: ...

Two-way data binding of controls in a user control nested inside a FormView doesn't work

I'm trying to perform two-way data binding on the controls in my user control, which is hosted inside a FormView template: <asp:ObjectDataSource runat="server" ID="ObjectDataSource" TypeName="WebApplication1.Data" SelectMethod="GetItem" UpdateMethod="UpdateItem"> </asp:ObjectDataSource> <asp:FormView runat="server" ID="FormView" Da...

Asp.Net - Can a LinkButton.CommandArgument be typed?

Okay so given a LinkButton inside a the ItemTemplate of a Repeater declared like this - <asp:LinkButton ID="restrictionDelete" runat="server" CssClass="restrictionDelete" Text="Delete..." OnCommand="lnkDeleteRestriction_Command" CommandName="Delete" CommandArgument="<%# Container.DataItem %>"></asp:LinkButton> Now,..t...

'System.Windows.Data.MultiBinding' is not a valid value for property 'Text'.

I'm trying to write a custom MarkupExtension that allows me to use my own mechanisms for defining a binding, however when I attempt to return a MultiBinding from my MarkupExtension I get the above exception. I have: <TextBlock Text="{my:CustomMarkup ...}" /> CustomMarkup returns a MultiBinding, but apparently Text doesn't like being ...

The uncatchable exception

Followup: http://stackoverflow.com/questions/3057822/the-uncatchable-exception-pt-2 I'm writing a custom binding engine; my converter is being called before DataContext is set on the target element. This in and of itself isn't a big deal because it will get updated when DataContext eventually receives a value. What is causing problems i...

WPF Converter and NotifyOnTargetUpdated exclusive in a binding ?

Hi, I have a problem with a databinding in WPF. When I try to use a value converter and set the NotifyOnTargetUpdated=True property to True, I get an XamlParseException with the following message: 'System.Windows.Data.BindingExpression' value cannot be assigned to property 'Contenu' of object 'View.UserControls.ShadowedText'....

Problem with UserControl with custom Dependency Property

Hi, I'm writing a user control with a dependency property for a search text called SearchText. It is a dependency property because I want to allow consumers of the control to use data binding. The user control contains a WPF TextBox where the user can enter the search text. I could use data binding to connect the SearchText dependency ...

ASP Stored Procedure to GridView

Hello All, I am attempting to use an existing stored procedure to populate a gridview. First, I execute the stored procedure and use a SqlAdapter to put it into a DataSet. I know this works because DataSet.Tables[0] contains my data. However, when I create a GridView and bind the data to the GridView, nothing is displayed. Here is th...

Setting a Visual State from a data bound enum in WPF

Hey all, I've got a scenario where I want to switch the visiblity of 4 different content controls. The visual states I have set opacity, and collapsed based on each given state (See code.) What I'd like to do is have the visual state bound to a property of my View Model of type Enum. I tried using DataStateBehavior, but it requires tr...

How to bind Listbox to two properties?

In Silverlight, I have a Grid with DataContext set to class ViewModel. The ViewModel contains list of items (each of them containing int ID and string Text) and an integer "ID", which identifies the currently active item (not selected item). I would like to construct xaml with ListBox where activated item has another color. How can I do ...

Databinding with Control Properties in Winforms: Bind Enabled to state of Combobox?

Hi all, I have barely any experience with WinForms, but I'm fairly sure that this is a simple task. I just need to enable and disable the Enabled property of a textbox based on the SelectedIndex of a ComboBox. Can this be done in the designer using DataBindings, or am I required to write a handler of some kind? ...

ASP.NET MVC Model Binding into a List

In my ASP.NET MVC site, part of a feature allows the user to enter the hours when a certain venue is open. I've decided to store these hours in a VenueHours table in my database, with a FK-to-PK relationship to a Venues table, as well as DayOfWeek, OpeningTime, and ClosingTime parameters. In my View, I want to allow the user to only in...

Binding Combobox to XML (wpf)

<EssenceList> <Essence GUID="464"> <Properties> <Property Name="Name"> <value>mt-1232-1. (1-1-3)</value> </Property> </Properties> <Characteristics> <Characteristic GUID="78"> <value>gadget</value> </Characteristic> <Characteristic GUID="79"> <value>measures</value> ...

Why doesn't my dataset.AcceptChanges update some new rows i've added?

I have a dataset in a datagrid with some data in it. Recently I've been asked to add some data to that dataset along with some controls to save the data from. I've added a few textboxes, 1 combobox and 3 textboxes that function as viewing of some datetimepickers that I have to use for dates. I've chosen to use textboxes in combination ...

Is there a .NET BCL class to help with hand-rolled property path binding?

WPF and Silverlight have a data binding model whereby I can provide a Binding with a Path which comprises a dot-notation of property accessors down from a DataContext to a specific value inside a complex object graph (eg. MyDataContext.RootProperty.SubProperty.Thing.Value) I have a (non-UI) requirement to accept such a path expressed a...