I have a Silverlight 3 application which calls a traditional .NET Web Service (asmx) to get a list of records and then display it in a ListBox control (lstRecords.ItemsSource = myRecords). Any records could be added or updated or deleted at anytime and I would like my UI (records displayed in the ListBox control) to reflect the latest ch...
I have an array of sample information that is constantly refreshed in a background thread.
Currently I am constantly assigning this array to a datagrid's ItemsSource property using a DispatcherTimer. That works but it resets any visual locations, for instance if the user places his cursor in the middle of the datagrid the execution time...
When I develop using Delphi I always call DataSet.CheckBrowseMode() to allow bound controls to apply its pending changes to the DataSet. I've been looking for similar way in .NET
I've tried
// When the user press Ctrl-S
// Apply any pending edit
this.TheDataBindingSource.CurrencyManager.EndCurrentEdit();
// then save the data
this.S...
Seriously, it seems like every time I want to make my UI elements talk to each other, I end up coding a new, custom, IValueConverter :(. Someone tell me that I'm doing it wrong, please!
Examples:
I wanted a button to be enabled only if my textbox contained a valid URI. Great, time to code up a UriIsValidConverter!
Oh oops, I also want...
Ideally I would like to put all the code to access and fetch the data from the database in a separate utility files and all those methods at data binding times from the .net code behind file. The problem comes is when should the connection object be closed. For simple stuff, the helper method can close the connection but for things like ...
Picture, if you will, a Visual Studio 2008 WPF application with a single window containing a ListBox. This application contains a method, outlined below, that binds the ListBox to the contents of a database table.
This application also happens to implement a WFC service contract, hosting said WCF service.
The data binding method below...
This is somewhat of a followup to my previous question, where people pointed me in the direction of MVVM.
I'm trying to understand exactly where the work is supposed to go in this framework. My view contains a textbox into which the user is meant to input a URI.
As far as I see, I have two choices:
Bind to a Uri object in my ViewMode...
I've modified my question since it has changed focus when trying things out.
I narrowed the problem down to the following...
I try to bind the selected Item of a TreeView to a StackPanel (or some other container that can hold User Controls). This container will then display a UserControl, depending on the type of the selected item.
Her...
Hello,
I created a user control and an associated view model. The properties "DisplayName" and "TimeIntervalLength" of the view model are displayed in the user control view DataBinding. Depending on those properties of the view model I want to update the width of my control.
The width should be "TimeIntervalLength" but at least "Display...
I'm trying to use DataGridView with a business object. Here's a simplified scenario:
- call the object "Recipe", and it has a BindingList of a few Ingredient objects in the Recipe
- I also have a "database", which is a BindingList of all available Ingredient objects
I would like to display a DataGridView of all the Ingredients in the ...
As you may know, Silverlight 3 doesn't support IMultiValueConverter and... I badly need it. A Web Service proxy which defines a class structure that I need to display in my UI. The object definition class has a few array property such as string[], int[], etc. When I bind these property to a TextBlock, the Text property of the TextBlock b...
In my WPF application, I have a databound TextBox and a databound ItemsControl. The contents of the ItemsControl is determined by the contents of the TextBox. I want to be able to type a value into the TextBox, press tab and enter the first item in the ItemsControl (created from the value in the TextBox ). The problem I am having is tha...
Hi,
I am trying to find a way bind Grid view to a JSON.NET parsed Linq to Json object
simply am calling
JObject yrs = SearchData("");
then use one property to be bound to Grid view
GridView1.DataSource = yrs["businesses"].Children();
I cant find any resources for something like that
neither binding directly work nor using Children...
I have a stackpanel which I want to make visible only when SomeTabControl.SelectedItem is not null - how do I do this in WPF binding?
...
I would like to perform a typecast within a binding declaration within code (C#). Here's a quick chunk of code illustrating my situation:
Binding aBinding = new Binding();
aBinding.Mode = BindingMode.OneTime;
aBinding.ElementName = "FullPagePageViewGrid";
//aBinding.Path = new PropertyPath("((IPageLayout)Children[0])"); // What I'd like...
Hi All,
I've a class on the server
[MessageContract]
public class RemoteFileInfo : IDisposable, INotifyPropertyChanged
{
[MessageHeader(MustUnderstand = true)]
public string _FileName;
[MessageHeader(MustUnderstand = true)]
public string FileName
{
get { return _FileName; }
set { _FileName = val...
I have this:
cmbConnections.DisplayMember = "Name";
cmbConnections.ValueMember = "Index";
cmbConnections.DataSource = DBConnectionSettings.ConnectionList;
All Ok!
Now add new item to list:
DBConnectionSettings.Connection c = new DBConnectionSettings.Connection();
c.Name = reply;
c.Index = DBConnectionSettings.ConnectionList.Count + ...
I have an AjaxControlToolkit ReorderList bound by a SQLDataSource to a table with the following schema:
OrgID MilestoneID Name Priority
The Priority field is attached to the ReorderList as its SortOrderField. OrgID is specific to each user that logs in. The idea is that there is a different list of Milestones for each Org.
I...
I have a datagridview which is initially bound to an empty datatable. Then the first row is populated by setting values to the columns of the grid's CurrentRow.DataBoundItem row.
I enter a new row manually by typing values in the last blank row. I hit a save button which does:
DataTable dt = (DataTable)MyGrid.DataSource.......
I noticed...
Hi there,
How do i extend an existing control (ComboBox in my case) to include a new property which i can bind to a property on my view model??
I have a Dependancy Property on the control's class as follows:
public class MyComboBox : ComboBox
{
public static readonly DependencyProperty MyTextProperty =
DependencyProperty.R...