0
голосов
2ответов
3866 просмотров

C#: Binding hashtable to combo box question

public class FontType { ... public String Name { get { return _name; } } public String DisplayName { get { return _displayName; } } public Font UseFont { get { return _font; } } } bindFontTypes.DataSource = availableFonts; comboFontType.DataSource = b...

3
голосов
1ответов
2532 просмотров

Adding new row datagridview to use default values

I have the following SQL that creates a table and inserts the first row of data without a problem. The default DateTime values are also inserted as expected. CREATE TABLE Jobs ( [Id] int PRIMARY KEY IDENTITY(1,1), [JobName] nvarchar(256) Default 'SomeName', [CreateDate] DateTime...

3
голосов
1ответов
1012 просмотров

DataBinding with a DataRow - problems

I am currently coding a project under c# and am experiencing problems. I'll give a brief description of my form: It has a datagridview on the bottom half of the form with single row selection, and is read only. On the top half of the form I have various components which are databound to the sele...

0
голосов
1ответов
1434 просмотров

Silverlight XAML Binding -- Decimal to Double

I've got some Columns in a DataGridView that have their Binding property set to something like the following: Binding="{Binding NetPrice}" The problem is that this NetPrice field is a Decimal type and I would like to convert it to Double inside the DataGrid. Is there some way to do this?

1
голосов
2ответов
1851 просмотров

databinding to XML in XAML: How to append new XmlNode?

all I found so far about databinding to XML always only seems to be binding to a fixed XML structure. Would be nice, if anyone could point me in any direction, everything I tried so far seems very awkward. This is what I would like to do: Binding the Checked state of a Checkbox to a node within...

0
голосов
4ответов
70 просмотров

Multiple buttns on a page - not working

Can someone tell me why the following is not working? <head> <script language="javascript" src="/assets/js/jquery-1.3.2.js"></script> <script type="text/javascript"> $("button").bind("click", function() { alert("You clicked " + $(this).attr("id")); }); </script>...

0
голосов
2ответов
738 просмотров

WPF: Binding with nonstatic parameter? (newbie question)

This will probably be obvious but I can't find the best way. I want to show the user's ToDo's in a listbox. These ToDo's are in the database and consist of an Id, UserId and Description. The user logged in to the app. How can I retrieve the ToDo's for that certain userId and set it up for bin...

2
голосов
1ответов
114 просмотров

Binding to the actual of a UserControl in Silverlight?

Seen some questions on SO but none answers my question. What I want to accomplish: I have a custom control (lets call it A) which moves around the canvas using a storyboard. And I want to bind another custom control's canvas (lets call it B) position onto the first control. Using the Transform...

1
голосов
1ответов
1040 просмотров

inline or databind expressions in ASP.NET

it's a related question to this one, but merits its' own question. If I need to call a server-side function inside my EditItemTemplate of my DataList, should I use <%=ServerSideFunction(...)%> or <%#ServerSideFunction(...)%>? Both work since there is a databind going on with the DataL...

2
голосов
1ответов
2595 просмотров

Simple databinding - How to handle bound field/property change. Winforms, .Net

I have a custom control with a bindable property:- Private _Value As Object <Bindable(True), ... > _ Public Property Value() As Object Get Return _Value End Get Set(ByVal value As Object) _Value = value End Set End Property Any time the field, that Value i...

5
голосов
4ответов
6885 просмотров

How to get a WPF Toolbar to bind to a collection in my VM without using expander

I have a WPF window that has a ToolBar. I have a collection of objects in my VM that I'm binding to. They appear as buttons but they always get pushed to the expanded drop down part of the ToolBar. How do I make those buttons appear in the standard part of the ToolBar? I have the following XA...

0
голосов
1ответов
958 просмотров

Multiple data binding properties on ASP.NET usercontrol

How can I have multiple properties in my usercontrol that can be databound? For a single property I have found that DefaultBindingProperty Attribute does the trick but I have no idea on how to get databinding with multiple properties.

1
голосов
1ответов
207 просмотров

Code Expressions in ASP.NET Themes

Binding expressions (e.g. ) are only permitted in ASP.NET skins in a very limited manner. It appears that only Eval(“”) statements with literal arguments are accepted. No formatting functions or composite expressions are allowed. Two part question: How does one support Text='' inside a sk...

1
голосов
1ответов
115 просмотров

recommendations for material on data binding

any good recommendations for databinding. i am starting to look into WPF more and i want to fully understand the how databinding work under the hood here. also, WPF is just one example as i assume there is a common pattern with tech like asp.net mvc data binding, etc.

2
голосов
1ответов
380 просмотров

Have a databound WPF Listbox generate subclassed ListboxItems

I would like to have my WPF Listbox, which is databound, generate subclassed ListboxItems instead of the regular ListboxItems. In this case, a DataTemplate is not sufficient because I need some custom properties for the subclassed ListBoxItems. Is there a way to have the ListBox generated mySubC...

4
голосов
3ответов
4106 просмотров

Get public string in codebehind into LayoutTemplate of ListView

A doubt in ASP.NET(VB) I have a public variable in code-behind(ASPX.VB) Public _orderCode As String = "Hello World" At ASPX, I would like to access it inline. That too inside the LayoutTemplate of a ListView <asp:ListView runat="server" ID="listView_OrderReplies" DataKey...

1
голосов
2ответов
557 просмотров

Binding a POCO to an html document and generating the result to a string

I am trying to return an html string from a method in a class library (don't ask why). What i would like to do within the method is get an instance of a POCO from my domain, then open an html document (maybe from a file or maybe it is a string from somewhere else), then pass the POCO to the docu...

0
голосов
3ответов
590 просмотров

Having trouble binding list/grid to collection

I have set up a grid and bound it to a collection. I can edit the items in the collection through my grid and the changes get propagated to the collection. And, the GUI is showing everything in the collection at the time the ItemSource is set. But, I am programmatically changing some of the it...

2
голосов
3ответов
13960 просмотров

Detecting when a row has changed in a dataset/datatable

I'm trying to add some extra logging to my C# winforms application. I have a few data bound forms that all the database stuff is managed by a binding source and some typed datasets/adapters. With this setup, it's kind of difficult to tell when something is changed, I'd have to manage each field ...

1
голосов
2ответов
1758 просмотров

Data Trigger not firing

I have a custom user control that exposes two dependency properties, IsBusy and BusyText. What I want is for the control to appear when IsBusy is set to true... Here's the xaml for the user control <UserControl x:Class="MyNamespace.BusyDialog" xmlns="http://schemas.microsoft.com/winfx/2006/...

9
голосов
2ответов
11747 просмотров

Binding ObservableCollection items to UserControl in WrapPanel?

I may just be missing something obvious here, so I apologize if this is a really dumb question. I have a WrapPanel in a view that I need to bind to an ObservableCollection on the ViewModel. This ObservableCollection contains a different type of ViewModel that needs to be bound to another type of ...

0
голосов
1ответов
2004 просмотров

(MVVM) Model View View Model And Threading

I'm playing around with the (MVVM) Model View View Model design pattern but I ran into a problem with the pattern. In my scenario I'm using a DataTable as the View Model. This View Model is set as the DataSource of a DataGridView. Normally, when the Presenter adds a new row to the View Model, a n...

0
голосов
2ответов
1793 просмотров

Maintaining usercontrol state on dynamically added usercontrols

I have a page that dynamically creates multiple usercontrols on the page_init event, and adds it to a placeholder on the page. The usercontrols themselves databind to a repeater on page_init to a collection of about 10 strings, which outputs a div for each item. There's also a "view more" link ...

2
голосов
1ответов
1390 просмотров

Get or Set Accessor of Attached Property not firing on databind? WPF

I have a custom Attached Property but the Accessors on never being accessed on databinding. Are theses accessors meant to be accessed everytime the attached property changes? public static readonly DependencyProperty CharacterColumnNumberProperty = DependencyProperty.RegisterAttached("...

1
голосов
1ответов
233 просмотров

Databinding with WPF User Control

I've been Googling for it; but without any luck. I think this is fairly simple. I have a user control named TicketGroup. TicketGroup is the visual representation of a List object I have. The XAML code I've got looks like this. <c:TicketGroup Grid.Row="1" /> <c:TicketGroup Gr...

2
голосов
3ответов
1516 просмотров

How can I bind a custom object in code-behind to a Grid in XAML?

In the following example, the Message property binds correctly but the FirstName, LastName and Age properties of the Customer object are blank. Why is that? XAML: <Window x:Class="TestBinding9922.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http...

2
голосов
1ответов
2434 просмотров

Silverlight Update/Trigger IValueConverter in Listbox DataTemplate in a DataGrid

I am building an application to display a datagrid bound to an ObservableCollection of Records, where each record has a Course Object and an ObservableCollection of Results Objects. The course is changed using an autocomplete box. The results collection is displayed in a Listbox with an IValueCo...

0
голосов
1ответов
109 просмотров

How come the getter on a property on an object fires even though no part of my form is asking for that property?

Normally a databound winform only fires the getters for the properties which match textboxes, grids etc But as I page through a collection (via BindingNavigator NextItem/PreviousItem), I'm finding that if I set a datagrid's DataSource to a property, then remove it, that property getter thereafte...

0
голосов
1ответов
3642 просмотров

Binding WPF ComboBox to entity

Ok, Ive searched the heck out of the Interwebs and can't seem to find this right. I have a ComboBox that is bound to a CollectionViewSource of EntityFramework entities. The display is a template that shows the first/last name. The problem is, when an item is selected, the Display of the combob...

2
голосов
3ответов
393 просмотров

Silverlight and binding to anonymous types

ScottGu indicated in an admittedly old post that databinding to anonymous types "just works" because anonymous types are just "syntactic sugar" (whatever that means) and from the CLR perspective they are every bit as real a type as anything I would write up. However Mike Hillberg posts that su...