databinding

Why is this DropDownList data binding to a List<String> not working?

I'm trying to bind a List<String> to a DropDownList in a user control. I think I'm doing the right thing, but it seems that after my code executes the bindings are cleared. Here's the code for review! User control: <asp:DropDownList ID="subjectNameDropDown" runat="server"/> <asp:DropDownList ID="yearLevelDropDown" runat="server"/> Au...

Why so many ColumnDisplayIndexChanged events when DataBinding a DataGridView ?

Hi, Can anyone explain to me how the ColumnDisplayIndex property is being used when a DataGridView is data bound ? The reason I ask is this. I have two grids, one above the other. I would like the user to be able to rearrange the order of the columns in the upper grid, and (via the ColumnDisplayIndexChanged event) reflect those reorder...

Can you use jTemplates for "Two-way bindings"?

Hi all.. Just toyed around with jTemplates today, and I love the idea. I was hoping I could find something similar to the data-binding model of WPF in it though, but so far I'm out of luck. Are anyone aware of such a model/framework? [EDIT] To clarify, I'd like something like MVVM, where I can have a back-end datasource in json format...

DataGridView with CheckBox cell problem

I have a DataGridView with a DataGridViewCheckBoxColumn column, which is databound to a list. The problem is that the databound boolean property for this checkbox is updated not when the check box is checked/unchecked, but after the CellLeave event in other words after the cell looses focus. I want this property to be updated right after...

How do you bind to Xml in SilverLight/Windows Phone?

I am trying to use Linq to Xml and Xaml data binding in a Windows Phone app with no luck, following this example. I've got some Xaml that looks like this: <Image Source="{Binding Path=Element[image].Value, Converter={StaticResource UriBitmapConverter}}" Grid.Column="2" MaxWidth="75" HorizontalAlignment="Righ...

In C# and WPF, can you bind an element of an array to an objects property?

For example, is it possible to bind a Textblock's Text property to an element Name[2] of type String? ...

OneWay binding on WinForms?

I have a control with a property public MyClass MyProperty{...} which value is shown on the screen as a graph. I want this property to be bindable to any other MyClass in the program by using the Binding class (MyProperty would be the propertyName parameter in this Binding constructor, and the other MyClass would be the dataMember parame...

graphical gui editor which incorporate database tables with python

(from your own experience) Is there a graphical UI editor / designer tool, commercial or free, which is able do design forms, and supports database-bound tables, before writing any line of code? PyQt Designer can't work with Databases, AFAIK (do you know how?) Dabo is the only thing so far that more or less works, but is quite heavy o...

C#: How to Bind Button.Enabled to Whether If There Is Any Item Selected of a ListView

Hi, I have a question about Control.DataBindings. How can I bind Button.Enabled to whether if there is any item selected of a ListView? i.e.: Button.Enabled = ListView.SelectedItems.Count > 0; I know that I can use ListView.SelectionChanged event to do this. I'm just wondering how can I use DataBinding to do the same job. Thanks. ...

Loading data into JsonStore

Hi, I'm trying to get some simple data into a JsonStore, but it doesn't seem to work. The code is pretty much the same as examples: var itemListStore = new Ext.data.JsonStore({ url: '/items/list', root: 'items', fields: [ {name: 'id', type: 'string'}, {name: 'name', type: 'string'}, ] }); itemListStore.load(); ....

ASP.NET PagedDataSource Paging Property Diffrence

What is the difference between (1) AllowServerPaging (2) AllowCustomPaging (3) AllowPaging of PagedDataSource ? please explain the situation to pick up the appropriate one. ...

Element Data-Binding in Silverlight

Dear all, I have a template column in a DataGrid: <sdk:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" > <TextBlock Text="{Binding Name,ElementName=rsAllSkills}"/> ...

Error with pageDataSource and Dataview "Index 40 is either negative or above rows count."

I am working with Gridview and implementing custom paging with PagedDataSource. there is also some search criteria in this page with which I reset the Grid with the New data according to search criteria. Problem is that sometime when I try to Bind the Grid with PagedDataSource it gives the error "Index 40 is either negative or above ro...

How to determine which DataRow is bound to a DataGridViewRow

Hi all. When I use a DataTable as a DataGridView's DataSource, I often have to find which row(s) a user has selected and read specific values from the DataTable (not the DataGridView) I wanted to know if there is any reliable way of determining which DataRow a DataGridViewRow is bound to especially when the user has sorted the DataGrid...

ASP.NET control for displaying single items?

When designing an ASP.NET user control my standard way for creating say a details view would be to create a property of the desired type on my page and would set the property in the page load based on the supplied query parameter. I feel I'm probably doing more work then necessary. If I could encase my view inside a container then I co...

binding to a list of tuples

I have a list of tuples pairing two pieces of data... I'd like to bind the list to a data grid. For display, it works fine... but if I try and modify an entry, it says "A TwoWay or OneWayToSource binding cannot work on the read-only property 'Item1'"... presumably Tuples are immutable in .NET 4.0. Is there an easy way to bind to pairs ...

asp.net binding problem

Hello, I have in my code behind the following property public string Firstname {get;set;} when I want to bind it to some textbox I do the following: <asp:TextBox runat="server" ID="txtFirstname" Text='<%# Bind("Firstname") %>'/> then I want value put in this textbox to be set in my Firstname property (because I want to process it ...

How to prevent debugger from breaking when ArgumentException is thrown when using ValidatesOnExceptions=true in WPF

I am using the ValidatesOnExceptions=true method of WPF validation. This involves throwing an exception in the source's property setter method. It works but the debugger always breaks when the exception is thrown. I am guessing that this is because the exception is not caught directly in my user code but it is caught in the WPF validatio...

ASP.NET MVC2 Strongly-typed view databinding question

I'll start off by saying my terminology might be off, which is why I might be having trouble finding an answer to this question, and apologising for the wall of text. I have a strongly-typed view that inherits from a custom type called Record. Record has a dictionary of named fields of varying datatypes - some strings, some ints, some D...

Problem setting a property on an Asp.Net custom dropdownlist

I'm trying to set a property on a custom DropDownList: <custom:ReferenceDropDownList ... ValidityDate="<%# Application.CreateDate %>" /> Even though I can see that Application.CreateDate has been set in the Page_Load method on the containing UserControl, the code-behind in the DDL never seems to pick it up. protected override void On...