I have a WPF Window that contains a TextBox. I have implemented a Command that executes on Crtl-S that saves the contents of the window. My problem is that if the textbox is the active control, and I have newly edited text in the textbox, the latest changes in the textbox are not commited. I need to tab out of the textbox to get the chan...
I'm a little surprised that it is not possible to set up a binding for Canvas.Children through XAML. I've had to resort to a code-behind approach that looks something like this:
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
DesignerViewModel dvm = this.DataContext as DesignerViewModel;
dvm.D...
I have two viewmodels. One which displays a collection of IPAddresses, and one which displays a collection of objects that has numerous parameters. One of these parameters is an IPAddress. So, I have another panel that binds to the properties of the second object. I would like a combobox to have the ItemSource set to the first object, bu...
Hello.
I have not done a lot with WinForms so I wonder if someone could give me a little assistance with this. I have a DataGridView that is bond to a IList<>. When I delete a selected record from the collection (ILIST<>) I get the following exception:
"System.IndexOutOfRangeException:Index 3 does not have a value"
I think my binding ...
I'm currently building a user control that displays a message when a Repeater is empty.
The idea is simple, provide the user control with the ID of the Repeater. When the user control is rendered look up the Repeater and check Items.Count. If it's zero then display the message.
I would like to add one more feature though. I want to be ...
Hi
I can create a normal SSRS Project and use a ODBC connection. But i cant create one with i want to create a Report Model Project???
Any idea why and how i can work around it?
Thanks in advanced!!
...
I have a DropDownList populated with a SelectList generated from (an anonymous type) that has two properties "CountryId" (int) and "Description" (string). I want the selected country in the list to be the defaultCountry.
Countries = new SelectList(countries, "CountryId", "Description", defaultCountry.CountryId);
where "countries" is a...
I have a DataTable bound to a DataGridView. I have FullRowSelect enabled in the DGV. Is there a way to get the selected row as a DataRow so that I can get strongly typed access to the selected row's values?
...
I have a ListBox containing a group of 'Expander' items, and what I would like to do is make the 'IsExpanded' property for each of them exclusive - i.e. if I have 10 Expanders in the ListBox, I'd like only one to be open at a time... Soo at present I have:
<Window>
<Window.Resources>
<DataTemplate x:Key="NormalTemplate">
...
I want to bind a list of KeyValuePair to a list of MenuItems.
I thought I should use MenuIten.HeaderTemplate, but it didn't work. I only got blank headers.
<MenuItem
Header="Template"
ItemsSource="{Binding Path=Samples}">
<MenuItem.ItemTemplate>
<DataTempl...
I am trying to bind a DataGridView to a List, where MyObject looks like
class MyObject
{
public string Property1 { get; set; }
public string Property2 { get; set; }
}
//List<MyObject> objects;
grid.Columns[0].DataPropertyName = "Property1";
grid.DataSource = objects;
I want only one property to be displayed, but instead I get...
Let's say I have a single XML node of content in my code-behind. I need to get some data out of the various nodes and onto a Web form.
Traditionally, I would create a bunch of Literals on the page, then do stuff like this in the code-behind:
MyLiteral.Text = myXmlNode.SelectSingleNode("/some/xpath").InnerText;
This is fine and good,...
I've done it one thousand of times and it works but now .... not :(
Am I doing something wrong here because nothing is shown in grid ?
namespace theGridIsNotWorking
{
using System;
using System.Collections.Generic;
using System.Windows.Forms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
...
Hi
I’m making a simple LOB app which loads data from an XML file and displays it in a list with a few buttons for editing.
In my first attempt, everything was ok except that the list scrolled downwards in one long column. I would prefer the data to wrap so that at the bottom of the Window it starts a second column, and so on – if you r...
i did this:
this.combobox.ItemsSource = Common.Component.ModuleManager.Instance.Modules;
to bind the combobox to a collection, which is located in an other project/namespace. But i had to move the ComboBox into a DataTemplate.
Now i need to do something like that:
<ComboBox ItemsSource="{Binding Common.Component.ModuleManager.Instan...
There are a lot of examples on how to use the built-in Model-binding capabilities to automatically get a List of items. But they all refer to the Beta-releases of ASP.net MVC. It is also mentioned that there has been a change in this Model Binding but so far I was not able to find a good source on how it now works in the Final Release. A...
I am currently attempting to implement a custom gridview interface to display data from an ObjectDataSource frontend to ASP.net membership. The asp.net code for the gridview is
<asp:GridView
id="grdUsers"
HeaderStyle-cssclass="grid_header"
RowStyle-cssclass="row"
AlternatingRowStyle-cssclass="alternating"
OnRowUpdating=...
I am using Spring MVC's SimpleFormController in conjunction with Spring MVC's form JTL to create a form to edit a Generic object.
On my form I have a drop down where the user can specify a server via a drop down.
<form:form commandName="generic">
<form:select path="server">
<form:options items="${servers}" itemValue="id" it...
Lets say I have an NSArrayController which contains items each with netCost and netProfit properties and I want to create a Total Percent Profit label (containing the sum of the profits divided by the sum of the costs).
In the controller class with a reference to the array controller I've attempted to do this as follows:
+ (NSSet *)key...
I have a list view that has a column databound to a list.Count see below:
<ListView.View>
<GridView>
<GridViewColumn Header="Contacts" DisplayMemberBinding="{Binding Path=Contacts.Count}"/>
<GridViewColumn Header="Notes" DisplayMemberBinding="{Binding Path=Notes.Count}"/>
</GridView>
</ListView.View>
The List i...