Can anyone tell me what is the c# equivalent of the following snippet of XAML ??
<my:DataGridTextColumn
Visibility="{Binding Path=DataColumns[21].IsVisible, Source={StaticResource viewmodel}, Converter={StaticResource vc}}"
Binding="{Binding SdDevDuration}"
/>
Its th...
I'm trying to get my datagridview control to remember the selected row after data refresh.
The DGV is databound to a list of business objects:
Dim FXs As SortableBindingList(Of FX) = FX.LoadAllForBinding(FXStatus)
Dim bs As New BindingSource
bs.DataSource = FXs
The overall sequence is something like this:
User clicks on a row
Row i...
How can I add WPF DelegateCommands to the items in a TreeView bound to an XmlDataProvider? I'm using the MVVM pattern and Composite WPF and I want the command to be called when the user double-clicks on an item in the TreeView.
I have a TreeView defined in XAML whose DataContext is set to the XmlDataProvider:
<TreeView
xmlns="htt...
Hi,
Is there a simple way in WPF to create a usercontrol with different modes for display, update or insert a new object?
I'm thinking (coming from a web background) something like a listview control where you can create display templates for the different modes. You can then quickly change the mode, depending what you need to do.
An...
Hi guys,
Has anybody come across ds.hasChanges() being false despite that the ds clearly has the changes while you check it at a breakpoint?
I've been looking at it for quite a while and I can't see what is wrong...
// connectionstring and command has been set
DataSet ds = new DataSet();
BindingSource myBindingSource = new BindingSourc...
I have defined classes:
public class Parent : IParent
{
public string ParentText
{
get { return "ParentText"; }
}
}
public interface IParent
{
string ParentText { get;}
}
public class Child : Parent, IChild
{
public string ChildText
{
get { return "ChildText"; }
}
}
public interface IChild ...
Hello all!
I want to be able to create a fade animation on a text element when the
binding to that element updates. In other words, the effect is that as
text gets added to a text box one sees a fading effect as the text updates
and then fades out. I do'nt know how to achieve this. I have seen something similar
using an EventTrigger on ...
I'm trying to get a Window's datacontext to be set to itself, but I can't figure out what the syntax should be.
<Window x:Class=" ...
DataContext="{Binding Self}"
Doesn't seem to work.
Any ideas?
Thanks!
...
I have a datagridview where the first cell is used to retrieve data for the grid. If I use the cellleave event to rebind the grid to a datatable, I get a "Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.", which makes sense.
Where can I bind the grid to a datasource after all the e...
I have two text boxes, one for a billing address field and one for a shipping address field. When the user types something into the the billing address text box the shipping address text box gets the same value due to the following binding scenario:
<TextBox Name="txtBillingAddress" Text="{Binding BillingAddress, UpdateSourceTrigger=Pro...
I am using Flex to create a small form. All I have at the moment is a List component, that I want to populate with a list of font names.
I am getting the fonts using Font.enumerateFonts(true);. This returns an array of flash.text.Font objects.
The Font objects have a fontName property that is a String of that fonts name.
My problem is...
Using XAML, I am trying to get a list box to display the list of system fonts.
I am not sure exactly what to type in the Bindings string.
Here's my attempt:
<Window x:Class="ListDataBinding.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmln...
Let's say I have a list of Customers (List) and each Customer has a State-property.
Is it possible to bind the SelectedValue of a ComboBox, so that it shows (has a SelectedValue of) e.g. "WA" if all Customers have WA as their State?
If the customers have different State-values nothing is shown.
But if I then choose OR, then all Custome...
I have a question about ASP.Net data binding - for a small internal tool I'm creating.
Simplifying the scenario, there's a page with some Repeater controls to display lists/tables, and also some edit boxes. Within Page_Load() I bind all the Repeaters from a business object (stored in ApplicationState). If it's not a postback then I also...
Hi,
I'm databinding a listbox to an object that contains two array of strings. Each listbox item is set to a data template made up of a textbox and a combo box. The first string array is bound to the list, and the second string array is bound to the combo box. Well, at least that's I'm trying to achieve. The problem is that I can't figu...
I'm attempting to utilize the .NET 2.0 ApplicationSettings feature for the first time, and find it a bit... puzzling in some ways. I'm hoping someone can help me figure out where i'm going wrong.
I have a generic settings class which i've implemented that is a subclass of ApplicationSettingsBase. I've implemented a property, and tagge...
I'm unable to use data binding in the ItemContainerStyle for a ListBox in Silverlight 3. It works fine in WPF. This is contrived example to demonstrate my problem. What I really want to is bind to the IsSelected property, but I think that this example is easier to follow.
I have a ListBox that is bound to a ObservableCollection<Item> of...
I have a TabControl whose items are bound to an ObservableCollection:
<TabControl ItemsSource="{Binding MyObservableCollection}" />
The tabs are added and removed as expected as items are added and removed from the collection. However, the SelectedItem reverts to -1 (meaning there is no selected tab) whenever the collection is empty. ...
Hi,
I guess it's quite a common problem in databinding scenarios.
What do you usually do, if you are running a batch update and want to avoid that a propertychanged-dependend calculations/actions/whatever are executed for every single update?
The first thing which usually comes to my mind, is to either introduces a new boolean or unhoo...
Hi,
I have a windows forms app in C#. Platform is vS 2005.
Following is the piece of code:
namespace HostApp
{
public partial class Form1 : Form
{
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox2.Items.Add("Apples");
comboBox2.Items.Add("Ora...