databinding

Binding forename and surname fields to a label?

I have a table associating an ID with a client's forename and surname (two separate fields). I have a TextBox on my form for a user to enter a client ID and I'd like a live update of the name displayed on a label, e.g.: TextBox: 1 --> Label: "Sam Pell" (user types 1) TextBox: 12 --> Label: "Andy Other" (user types 2) I have t...

Cases when binding are detached automatically

Today I faced a problem which reminded me of bindings being detached automatically in some cases. I am not sure but here is the scenario - I attach a menu item bound to a property(implementing INotifyPropertyChanged), like this - IsChecked="{Binding Path=DisplayLongUnit, Mode=TwoWay}" Now in its checked event hander I update its IsC...

Silverlight UI element's 1-time binding to nested non-dependency property fails

I want a 1-time databind between a checkbox (IsChecked propety) in a childWindow and a nested member variable in it's DataContext object, such that only the initial IsChecked property is set by the member variable. The member variable (binding source) is not INotifyPropertyChanged or marked as a DependencyProperty- but I think that is ok...

Bind DetailsView field to Function instead of Property

Is it possible to display the result of a function instead of the value of a property in a DetailsView Field? For example instead of: <asp:Label ID="m_LabelPlantCode" runat="server" Text='<%# Bind("PlantCode") %>'></asp:Label> maybe something like: <asp:Label ID="m_LabelPlantCode" runat="server" Text='<%# Bind("PlantCode(true)") %>'...

SL4 Binding problem with WCF RIA Services

Basic problem: How do I bind a textbox to the selected item of a combobox who's itemsource is the result of a LINQ query on a WCF RIA Services Domain context. Additional requirement: When the selected item is changed the binding should update. Additional requirement: The binding should be two way. My solution so far: After the user c...

Winforms. ObjectDataSource add calculated column

Hello. I use ObjectDataSource and bind IEnumerable[Person] to my DevExpress GridView class Person { private int Id {get; set;} public string Name {get; set;} } At grid there are two columns Id,Name. I want new column "Sum", which is calculated by person object(aggragate by person). At asp.net I create new column and calculate i...

Best way for automatic databinding between database and user interface in java swing app?

Hi, I'm currently facing a need of creating user frontend application to database with dozens of tables and thousands of fields. It should be java swing application, and I'm trying to find as most automated solution as possible. Ideally to completely avoid manual creation of DAO layer, beans definition and GUI creation. Currently we ...

Josh Smith MVVM: Add command from MainWindowViewModel Commands property to MenuItems

Hiexperts, trying to grasp the concepts behind the MVVM pattern, I'm playing around with Josh Smiths MVVM sample application (http://msdn.microsoft.com/en-us/magazine/dd419663.aspx). The sample app has a HeaderedContentControl where all the commands from the MainWindowViewModels Commands property are displayed. I'm struggling right no...

Thread safety, lists, binding and WPF

I have a WPF ListView that is bound to a collection (List<T>). It is currently updated from the current thread which works ok. I want to move the logic for updating the list into a thread and I see some potential issues regarding thread safety and the binding of the list. Can I be assured that the binding will not be updated unless I ...

Databinding Container documentation

Hi I usually use expressions like this CommandArgument='<%# Container.DataItemIndex.ToString() %> ' But I could not find Container in the msdn, can u help? Thanks ...

OpenXML: Creating reusable Content Controls with binding

I need to attach specific XML to a word document so the elements will show up in the right places. This I can do with OpenXML SDK. The thing is I want too be able to define the Content Controls already bounded in some sort of template so other people can create the real document template the xml will be attached to. Ok not sure people w...

Viewstate issue with efficient paging in Gridview without using data source control

Hi, I am getting the following viewstate error when I add a row to the last page of the gridview control with custom paging enabled. this error occurs when row count of last page is equal to the page size (works first time, fails when doing the same on next page). any idea what might be causing it? custom paging is implemented using t...

ListView Inserting Event - ListViewInsertEventArgs Values collection is empty

Given the following InsertItemTemplate (simplified) I'm not getting anything back in the event object's Values collection. <InsertItemTemplate> Item: <asp:DropDownList ID="ItemInsertType" DataTextField="SearchItemName" DataValueField="SearchItemID" runat="server" /> ...

insert data from a asp.net form to a sql database with foreign key constraints

i have two tables asset employee assetid-pk empid-pk empid-fk now, i have a form to populate the asset table but it cant because of the foreign key constraint.. what to do? thx Tk ...

How to bind data to DropDownList in UpdatePanel inside DetailsView

Hello! I use DetailsView to insert rows in database. Row has fields id, subcategory_id etc. I want to fill dynamically dropdownlist ddl_subcategories, which is used in TemplateField. Selected item value of first dropdownlist ddl_categories is used as parameter for generating collection for ddl_subcategories. I try it with using UpdatePan...

Eclipse DataBinding: Delay model updates until dialog confirmation

I have a TitleAreaDialog with default buttons where I use data binding to synchronize the model and the widgets. How do I delay model updates until the user clicks the 'OK' button? Thanks! ...

C# WinForms - Databound simple components with Cancelable form

How can I implement a form with simple components (text boxes, comboboxes) bound to an object's properties and have Save/Cancel support? I have tried the code snippet at http://fgheysels.blogspot.com/2009/06/winforms-databinding-on-cancellable.html but I dont know what is required for this to work binding to object properties. This is ...

Format Telephone Number in GridView

I see another thread somewhat like my question at: http://stackoverflow.com/questions/1180403/asp-net-gridview-column-formatting-telephone-number but i do not know if it answers my question as he is using code-behind to make the colum. All I did was insert the GridView control in visual studio. BTW, the data is being populated in the G...

Winforms data binding: Can a TypeConverter be used instead of the Format/Parse events?

In a Winforms form, I want to provide visual cues to the user when an input field contains an invalid value. To that end, I want to bind the ForeColor property of a input field's label to the (boolean) IsPropertyValid property of the underlying model such that the label turns red when IsPropertyValid == false. What I currently have is a...

Why can I not bind the Visiblity of a DataGridTemplateColumn in Silverlight 4?

It seems that it is not possible to bind the visibility property of a DataGridTemplateColumn in Silverlight 4 still. I did some Googling and there seem to be a few posts suggesting it was to do with the fact that it was not a DependencyObject and how this would change in SL4 but it does not seem to be the case. To work around it, I do i...