databinding

Databound WPF ComboBox with 'New...' item

Hi all I have a combobox which is databound to a list of elements. But in addition to that list of elements, i want to have another item. This item should display the text 'New...' The idea is if they select one of the normal elements, it performs some action involving that element. If they select the 'New' element, it will take them to ...

PRISM-MVVM, ItemsControl problem with View injection

Hi, I need to display multiple instances of a basketDetailsView.xaml within a region placed in basketView.xaml, but I'm getting the following errormessage when i debug my code: "An exception occurred while creating a region with name 'basketRegion'. The exception was: System.InvalidOperationException: ItemsControl's ItemsSource propert...

Bing maps two-way binding to Center property. Animation problem

Hi folks, There is an example of two-way binding to Center property from Micrsoft guys. You can find it here. Its sample works fine, but they disabled full animation. When I set AnimationLevel="Full" and use the Compass I get trembling picture. I really like aminations effects and don't want to turn it off. Are there any ways to get ...

Silverlight UI not unsubscribing from PropertyChanged events

I have a data bound UI. When I change the underlying data the UI updates fine but the controls appear to remain subscribed to my PropertyChanged events. I have the following: An ItemsControl bound to ListA Each item ListA contains a sub list ListB that is displayed using another ItemsControl Each item ListB is displayed using a TextB...

WPF ListBox with ItemTemplate problem

I have a listbox and I am trying to Bind DataTable with it. I debug the Code and there is data in the DataTable but it does not show the data inside the DataList. <Window.Resources> <local:myCurrencyColor x:Key="CurrColor"></local:myCurrencyColor> </Window.Resources> <Grid Name="grid1"> <ListBox Margin="28,111,130,24" N...

jQuery binding data with view

I'm writing an app that is a 'power meter' of sorts where I show a list of 'locations' in the navigation that have a power rating associated with them, and a gauge that aggregates this information. Locations can be nested. Clicking a location changes my app's 'state' and loads its child locations into the nav. Clicking back takes user ...

Handle errors when databinding a query parameter to a datasource?

How can I handle errors when I use databinding to databind a query parameter to a datasource control? I have 3 questions: How can I validate that the query string data is correct before it is bound to the datasource? How can I handle errors when the data is in the correct form but an error is generated from the database? Is it safe ...

asp.net datalist data binding

I am using an asp.net/c# datalist. <asp:DataList ID="EquipmentList" RepeatColumns="5"..... I have the following line inside the <ItemTemplate> tag: <a href=""><%# {I want to put something here but dont know how} %> </a> In my code behind I have a NameValueCollection variable that contains all strings: NameValueCollection myListo...

ASP.NET Gridview paging does not work if the grid is not loaded during Page_load. Tried all methods

Hi, I have a gridview which I load with data on click of a button. For some reason the paging did not work. The paging number shows up but clicking on page # 2, 3 or 4 does not take you anywhere. the grid just disappears on clicking them. right after that when i click the button to generate the grid, the grid came up this time the gird ...

What's wrong with TextBlock IsEnabled binding?

I've got a simple text block with a label and text box as content. I would like to bind the IsEnabled property of the text block to a property on my view model. For whatever reason the label and text box stay disabled even though the IsEnabled property is changing properly on the view model. Anyone know what's going on here? This does...

Changing page title dynamically depending on a databinding result (ASP.NET)

Hi, I'm newbie in ASP.NET I have a page to show a thread content, it take the ID of the thread from the query string. depending on the ID, I show the content using the FormView control. how could I then change the page title depending on the databinding result? I've figured out that I can do that before the databinding in the Page_L...

Editing an item in asp:ListView control

I have an asp:listview bound to sqldatasourceA. In my edititemtemplate, I have a dropdownlist bound to sqldatasourceB. This listview shows users and the group they belong to, and when they go to edit a user, I want to populate the dropdownlist with all of the groups, then select the one they are currently assigned to. However, I can't...

WPF Data binding to project settings

Hi In my app, i data bind two text boxes to project settings. <Page.Resources><p:Settings x:Key="Settings" /><Page.Resources/> <TextBox Grid.Row="3" Name="textBox1" Text ="{Binding Source={StaticResource Settings}, Path=Default.Number_Of_Versions, Mode=TwoWay}" Grid.Column="1" Height="30" /> In the textbox i see the number of vers...

How to bind an array of DataRows to a DataGridView

I'd like to partition my search results (which is in a DataTable) into groups of say 100 so the user navigates through them a chunk at a time. I thought I could bind an array of DataRows to a DataGridView as the DataSource but it just does not work. This is the code I tried DataGridView.DataSource = (From r In DataTable.Rows Skip 200 T...

ListBox with ItemTemplate: SelectionChanged not fired

ListBox with ItemTemplate: SelectionChanged not fired What's wrong? <ListBox ItemsSource="{Binding Source1}" SelectionChanged="ListBox_SelectionChanged" SelectedItem="{Binding CurrentItem, Mode=TwoWay}" HorizontalAlignment="Stretch" Margin="0" Padding="0"> <ListBox.ItemTemplate> <DataTemplate> <Grid Margin="0"> ...

Include,EF, ASP.NET and dropdownlist

I have a problem with include in EF, ASP.NET and dropdownlist. with the asp.net page : <asp:EntityDataSource ID="ds" runat="server" ConnectionString="name=CoreEntities" DefaultContainerName="CoreEntities" EnableFlattening="False" EntitySetName="Articles" Include="TraductionTitre"> </asp:EntityDataSource> <asp:DropDownList ID="Dr...

How to format DateTime columns in DataGridView?

Hello, I'm using a DataGridView with object data binding to display information about logging entities in a system, retrieved via SOAP from a remote service. One of the columns is called "Last action" and means the last time the entity logged a message. It is a System.DateTime value. When I read the SOAP response (example below), he time...

Databinding in .NET - Datatables, Dataviews and BindingSources

Hello, When binding to datatables in visual studio, it sets the datasource of a bindingsource to the selected datatable - which is fine and is what is expected. However, the datasource is actually pointing to a dataview of that datatable. I'm currently implementing custom business object base classes which include collection classes. I...

Binding XML file to a UserControl

I want to bind the data from my XML file to my userControl. So far I have: XML file: <?xml version="1.0" encoding="utf-8"?> <testData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <pumps> <pump> <speed value="1200"/> <color value="Black"/> ...

Silverlight datagrid header binding to constant

Say I have a bunch of local constants in my code behind that I want to use as headers, for example: const string TYPE_HEADER = "Type"; const string LOCATION_ HEADER = "Location"; etc. Is there any way I can bind the headers of my DataGridColumns to these like events are bound to local methods, for example: <data:DataGridTextColumn H...