databinding

binding gridview to objects

My C# app contains a Data Object like this: public class Data { public class a {get;set;} public class b {get;set;} } public class a { public int first {get;set;} } public class b { public int second{get;set;} } I initialize my data when the application starts and my data changes evey time the app is running. I have...

Casting "value" in C# property as a IEnumerable<> generic in DataSource override.

Here is your basic DataSource override: public override object DataSource { get { return base.DataSource; } set { base.DataSource = value; } } What I would like to do in the setter method is cast value to IEnumerable<> and do some manipulations on i...

ASP.NET AJAX 4.0 client side databinding

I read some articles in MSDN magazine about new features in ASP.NET AJAX 4.0 - primarily client side data binding. I feel MSDN magazine sometimes contains a lot of "marketing" so I'm interested in opinions of real developers. Does it worth it? Do you plan to use it? Edit: Here are links for articles if anybody is interested. But at th...

In C, would XML be a good format to use internally for a RPG engine?

I am a novice C coder who would like to write a role playing game resolution library. What I mean by this is that this program would only deal with resolving those conflicts which is piped into it. For example, when informed that Captain Amazing uses his Blasto eye beams at medium distance with his d8 Shooting Skill costing 3 Power Poi...

TextBox - binding property doesn't refresh itself

Hi I have a textbox which Text property is bound like that <TextBox Name="txtBox"> <TextBox.Text> <Binding Path="Data"> </Binding> </TextBox.Text> </TextBox> The filed Data can be changed in various places in my program. However if I change filed Data in ahother control, the t txtBox Tex...

C# / .NET: Move to desired Item in BindingNavigator

I'm using such a BindingNavigator to let the User move through Data Records of a BindingSource. How can I change the displayed page to a desired page number through the program? I already set the PositionItem to the desired page number, but that just changes the displayed page number and doesnt move to this page. I'm sure it's not di...

WPF/XAML Databinding Question

Hello, I am writing an application in C#/WPF and am trying to figure out how to databind the width of the grids column definitions to a fraction of the screen width. Is this possible? Essentially I want something like this: Grid = 2x2 Row 1 Height = 2/3 of screen height Row 2 Height = 1/3 of screen height Row 1 Width = 2/3 of screen wid...

DataBinding EventHandler arguments

i have a label control inside a repeater template which im adding an event handler to for databinding. LiteralControl Item = new LiteralControl();; Item.DataBinding += new EventHandler(Name_DataBinding); how do i pass additional parameters into the databinding function? ...

WPF XML Databind to ComboBox

HI All, I am trying to bind some XML into a combobox using the below code: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="myComboBoxControl"> <UserControl.Resources> <DataTemplate x:Key="dataTempla...

Binding WPF control to multiple sources (not traditional multibinding)

I am trying to do some databinding magic. I have a Shipments view that lists shipments, and provides filtering and ordering ability on the list. The filter string box, Delivery Status filters (checkboxes) and Ordering Radiobuttons are databound to properties in the ViewModel. I want to add the ability to save state and I have elected ...

[WPF/XAML/C#] Why databinding TwoWay don't work on the text property of a combobx in .net 4.0 ?

Hello, Why databinding TwoWay don't work on the text property of a combobx in .net 4.0 (it's working in .net 3.5) ? My code : I have an xml file like this : <xml> <combobox option="" obs="tralala"> <option value="here" /> <option value="there" /> </combobox> <combobox option="blue" obs=""> <option value="one" /> ...

Databinding to cascading IEnumerable

Greetings! I have classes like these: class TestClass1 { ... } class TestClass1Array: IEnumerable<TestClass1> { //some properties plus full IEnumerable support } class TestClass2 { public TestClass1Array Test {get ... set ...} ... } class TestClass2Array: IEnumerable<TestClass2> { ... } is it possible to bind them to 2 listboxe...

Binding mxml (as)

I have actionscript file with a binding {someBinding}... The Main.mxml is where all the action happens. If I set {someBinding} in the "text" of a label component I will have a number. I have another form.mxml file. Where I want that binding to be in, but it can't find such binding. I need to have that {someBinding} in that other mxml,...

Breaking out of the Data Binding hierarchy

Hey all, I'm kind of new to WPF, and I'm trying to do some specialized data binding. Specifically, I have a DataGrid that is bound to a collection of objects, but then I want the headers of the columns to be bound to a separate object. How do you do this? I have a couple of classes defined like so: public class CurrencyManager : INot...

Creating an infinite Silverlight ItemsControl

I'm interested in creating an ItemsControl for Silverlight that "loops" the items. When the user scrolls to the end of the list the ItemsControl should then show the first item(s) in the list. If the user scrolls above the first item in the list the ItemsControl should show the last item(s) in the list. It probably makes sense here fo...

WPF: Binding lists in XAML- how can an item know its position in the list?

Given the following XAML code that with a ListControl like behavior: <StackPanel> <ItemsControl Name="_listbox" ItemsSource="{Binding ElementName=_userControl, Path=DataContext}"> <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> ... ...

Binding doesn't update the property

I have DataDependentControl with dependency properties defined: TextVisibility, CalendarVisibility, ComboControlVisibility. When I select some values in outside combobox with enumerated datatypes, the properties mentioned above are updated to Visibility enumeration value, but binding doesn't update Visibility property on inside controls:...

Change binded object property on button click in WPF

I have binded an object to a WPF control. How can I toggle the object property "IsEditMode" on click of the edit button using only xaml and no code behind? Here is sample code of xaml - <Label Style="{StaticResource TitleLabel}" Content="{Binding Path=GroupTitle}" Visibility="{Binding Path=IsEditMode, Converter={StaticRe...

RIA Services and MVVM loading, a question about querying data (separating data)

First of all, sorry for the bad title, I can only describe the problem Let's say the database on the server has a table/type called Tasks and these tasks can be owned by a user and assigned to a user. SomeTask.Owner = SomeUser SomeTask.Assignee = SomeOtherUser In the server some additional queries are defined: public IQueryable<Task...

How to report that custom (added) Calculated Property of entity object has changed?

First, I apologize for my low level English writing. I use Entity Framework and data-binding in WPF MVVM project. I would like to know what is the best way to do data binding to added calculated property of EntityObject which is generated with Entity Framework. For example: partial class Person { partial string Name....