databinding

How to Bind List<myclass> data with gridview?

Look please my web service codes return type List i get data from web service with listformat List; also created a gridview below and return list to gridview datasource.Bur eror occurs: A field or property with the name 'name' was not found on the selected data source. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns...

ASP.Net: Is it possible to skip databinding of an element if an error occurs?

Hey everyone, I use a lot of repeaters for different elements of our sites, and I've always wondered if there was a way to have the repeater skip an element if an exception occurs instead of having the whole page crash? In particular, I've inherited a system from another developer that using a similar design, however he didn't include ...

DataBinding with DataContext

Hi, what am I doing wrong here? I'm trying to create a DataTemplate using a collection inside the DataContext object, like the following: C#: namespace StackOverflowTests { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { I...

Problem binding to static property

I'm having a hard time binding a simple static string property to a text box. Here's the class with the static property: public class VersionManager { private static string filterString; public static string FilterString { get { return filterString; } set { filterString = value; } } } In my xaml, I j...

React to change on a static property

I'm re-writing an MXML item renderer in pure AS. A problem I can't seem to get past is how to have each item renderer react to a change on a static property on the item renderer class. In the MXML version, I have the following binding set up on the item renderer: instanceProperty={callInstanceFunction(ItemRenderer.staticProperty)} Wha...

Sharing a DataTable across multiple forms in winforms

I'm trying to write a simple Compact Framework winforms app. The main form has a DataGrid bound to a DataTable (with data from an xml file). I want to bring up another form that displays the details of the current record. I have something like the following code as the constructor for the detail form. public DetailsForm(DataTable dtL...

WPF: can a DoubleAnimation be applied to any double, or just a dependancy property?

Hi all! Can DoubleAnimations be applied to any double? Or just some? In WPF, I know you can create a DoubleAnimation object: var ani = new DoubleAnimation(); ..and that object can be used in the BeginAnimation method of UIElements. In my case, however, I'd like to just apply the animation to the object the the UIElement is bound t...

WPF searchbox and databinding to treeview

I'm trying to implement a real-time updating search bar which updates a TreeView when search phrase changes, however I don't quite manage to get it to update the way I want. All the items are present in the treeview at application startup (it only contains one level of children at the moment). The SearchPhrase property is also updating ...

WPF Databinding based on conditions

Goal Develop a custom control which displays summary data for a specified week. The data passed in would be as follows: 3rd May 2009 Customer A $2000 4th May 2009 Customer A $3900 6th May 2009 Customer B $1900 The expected display would be 3rd May 4th May 5th May 6th May Cu...

ASP.NET Listbox databound to List of custom objects. Does it keep the actual objects?

Hi All, in ASP.NET, I've bound a listbox control to a List of custom class (consisting of a TimeSpan and Int members). the ToString() function just displays them both as a long string. Now I want to save the modified listbox into the DB again, I need to use the custom class objects again. Does the ListBox save the actual custom object...

DataGridView, DataTable, SqlDataAdapter and SqlCommandBuilder - disable deletes

I have a WinForm that has a DataGridView table. It is bound to a DataTable in conjunction with a SqlDataAdapter and SqlCommandBuilder. What is the best way (easy and easy to manage) of disabling Deletes but allowing Selects, Updates, Inserts? Is there a one line property I can set on the grid? That is how I would prefer to do it. ...

Binding a GridView control to a DataTable

What is the sytnax for displaying a data table column on an ASP.NET page (.aspx)? I know it it along the lines of Container.DataItem, it has been awhile since I worked with DataTable object ...

Does anyone have code examples of the WPF Datagrid working in a MVVM pattern?

I got the following example of a WPF DataGrid bound to a ViewModel in a MVVM pattern, but it is read-only: MVVM example which has buttons that switch the data in the ViewModel I tried to extend it so that the DataGrid was bound to an observable collection of ViewModels so that editing cells would fire OnPropertyChanged events on the ap...

Silverlight databinding to locate UIElements

Is it possible to locate UIelement(s) on the visual tree in silverlight by inspecting the databinding somehow for a business object being bound. What I want to do is locate elements using a lambda expression (or any other means) from the element being bound something like: var uielements = FindAllUIElements ( (businessObject)=> { busine...

Problem DataBinding wpf KeyedCollection

Hello, I am a beginner to WPF Databinding and I just found a confusing kind of behaviour. Maybe someone can help me: My xaml code binds a listbox to a list: <ListBox ItemsSource="{Binding Path=Axes}" SelectedItem="{Binding Path = SelectedAxis}" DisplayMemberPath = "Name" Name="listboxAxes"/> If the actual item that is binded to is ...

JavaScript libraries / toolkits that support binding JSON data to HTML controls?

Are there any JavaScript libraries or Toolkits that allow me to bind the JSON data to html controls on the client? So essentially I should be able specify the object property to which a html control should be bound. Hence when the form receives the JSON data, the controls are updated, and when the controls are updated, the data should b...

Binding an ASP.NET GridView Control to a string array

I am trying to bind an ASP.NET GridView control to an string array and I get the following item: A field or property with the name 'Item' was not found on the selected data source. What is correct value I should use for DataField property of the asp:BoundField column in my GridView control. Here is my source code: ASPX page ...

WPF TextBlock Binding to DependencyProperty

Hi, I have what I believe to be about one of the most simple cases of attempting to bind a view to a dependencyproperty in the view model. It seems that the initial changes are reflected in the view but other changes to the DP do not update the view's TextBlock. I'm probably just missing something simple but I just can't see what it is. ...

DataGridView, ADO.NET, Binding, and Paging on the Client

I'm working on a WinForm application that has several queries that bring back approx 20000 records and then fills a DataTable, and binds that DataTable to a DataGridView. I want to allow the users to page through the grid 500 records at a time. What is the best way to do this? I want to do the paging on the client side. I see that the S...

Dealing with Databinding Errors in ASP.net

This has been bugging me for a while but when I databind a control using with a Session variable as the parameter which has not been initialized there is an exception thrown which I can't seem to catch anywhere. Ideally if the session varaible is not set I would just like to redirect but I can't seem to figure out where I need to check ...