databinding

Remove selected items in DataGridView (and DB)

Hi, I have a DataGridView connected to a Database. It is filled like this: Me.KeywordsTableAdapter.Fill(Me.DbDataSet1.keywords) I can see all the data inside DataGridView. Now I can select something and if I press on DELETE (Keyboard) the entries are gone (AllowUserToDeleteRows = true), but they are still in the Database (mdb file) ...

Why does WPF Style to show validation errors in ToolTip work for a TextBox but fails for a ComboBox?

I am using a typical Style to display validation errors as a tooltip from IErrorDataInfo for a textbox as shown below and it works fine. <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{B...

WinForms - Databinding to 2 tables on 1 form and saving to the database

I have a form that contains information about a client eg/Title, Name and their Address eg/Town, Country. I have a class for each table that has a Save method to update the database. I am thinking of having 2 bindingsources one for client and one for address. The controls will bind to the relevant bindingsource. When the user clicks ...

How can we block the user from unchecking a DataGridView checkbox?

We have a DataGridViewCheckBox column bound to a boolean property in our class. The property setter has some logic which says that under certain conditions a True flag cannot be changed, ie, it stays checked forever. This is on a per record basis. So the entire column can't be readonly, only certain rows. Pseudo code: Public Property ...

Bind SelectedValue of ASP.net DropDownList to custom object

Currently I have a DropDownList inside a FormView, databound to an ObjectDataSource. This is the DropDownList, which has it's own datasource, which returns a List of Departments: <asp:DropDownList ID="DepartmentsList" DataSourceID="DepartmentsListDataSource" DataTextField="Name" SelectedValue='<%# Bind("Department") %>' runat="server" /...

WPF Databinding a User Control

I have a user control, A, which wraps a third-party date-picker control, DP. A tells DP's SelectedDate dependency property to two-way bind to A's SelectedDate dependency property, thus effectively exposing the wrapped date-picker's SelectedDate value. I then have a control X which contains an instance of user control A. This tells A's...

Winform radiobutton data binding

I am following the "Presentation Model" design pattern suggested by Martin Fowler for my GUI architecture in a Windows Forms project. "The essence of a Presentation Model is of a fully self-contained class that represents all the data and behavior of the UI window, but without any of the controls used to render that UI on the screen. A...

DataBinding woes

So I have this datagridview that is linked to a Binding source that is binding to an underlying data table. The problem is I need to manual add rows to the datagridview. This cannot be done while it is bound, so I have to work with the databinding. If I add the rows to the underlying datatable, when the datatable is saved, the rows are...

MouseBinding the mousewheel to zoom in WPF and MVVM

OK, I've figured out how to get my Grid of UI elements to zoom, by using LayoutTransform and ScaleTransform. What I don't understand is how I can get my View to respond to CTRL+MouseWheelUp\Down to do it, and how to fit the code into the MVVM pattern. My first idea was to store the ZoomFactor as a property, and bind to a command to adj...

Data Binding in axis2

I want to create a simple webservice using Axis2 1.5.1. The expectations from the webservice is: 1. interoperability 2. interaction with custom objects Do i require to use any data binding (initially i thought of using ADB) or is deploying WS using POJO sufficient? Do we have enough documentation for the Data binding? Because Axis2 quick...

Bind dictionary to repeater

Hey, I have a dictionary object <string, string> and would like to bind it to a repeater. However, I'm not sure what to put in the aspx markup to actually display the key-value pair. There are no errors thrown and I can get it to work with a List. How do I get a dictionary to display in a repeater? Thanks Answer: I used this code in ...

Handling Master and Detail tables on the same winform

I'm having trouble using databinding in a situation where the parent table, and it's 0-many detail table is displayed on the same form. The two tables are: CashReceipts and CashReceiptItems The form is controlled by a BindingNavigator on CashReceipt, and the CashReceiptItems are managed by a DataGridView. What's displayed in the datagr...

JGoodies list binding

Does the JGoodies list binding support binding list contents to a list object in the model? I know I can add listeners to the list model and domain model and coordinate changes between the two fairly easily, but I wasn't sure if JGoodies would do that. I could only find list binding that dealt with list selection events. ...

objectDataSource binding with ASP.NET gridview auto adding parameters

I have a gridview databound to an objectdatasource. Everything worked great until I changed 2 columns from asp:BoundField to asp:TemplateField. These are the UPC column and the Part column. I wanted to show a link button for each of these fields that take the user to another page. Now asp.net expects these two fields to be parameters on ...

WPF why is my ScaleTransform Frozen and how can I bind to it?

I have a pretty simple user control that I want to bind a ScaleTransform property to a DP in the code behind like so: <UserControl x:Name="RoundByRound" DataContext="{Binding RelativeSource={RelativeSource Self}}" ... > <Canvas x:Name="MyCanvas"> <Canvas.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="{Binding Zo...

XtraReports Null Reference Exception

Anyone who used the XtraReports, i have created a databinding on one of my LINQ to SQL objects and dragged some properties over the report, but when i set the datasource to an object i get NullReferenceException in ShowPreview() method. If i don't set the DataSource i see the preview correctly (basically only the picturebox i set as back...

WPF: Binding to a custom class "Cannot find source for binding".

Did this: public class myClass : INotifyPropertyChanged { public bool? myFlag = false; public bool? MyFlag { get { return myFlag; } set { myFlag = value; OnPropertyChanged("MyFlag"); } } public event PropertyChangedEventHandler PropertyChanged; public void ...

Binding to a list of points that have to be drawn in a winformControl

Hi, I have some hardware with some controls to it. There are some visual controls I want to use in My WPF application. I have a binding Source object and a WPF with A TextBox To make it work I use the TextBox.TextChaned to execute some code that is among othere things painting my lines (from the list of points). XAML <TextBox Text="{...

binding a winforms control's property to multiple object properties

I am looking for a solution to bind a property of a windows forms control (Text of a button or a label) to multiple properties of one (or more) objects via a formatting string. Basically, the displayed text on a button should look like "static text $1 more static text $2" where $1 is bound to the to the property of an object and $2 is bo...

How to clear the existing list data values

I would like to know how to delete(clear) the existing list data values before binding new values. I'm using the list for binding data dynamically using http services. When I make a new call to the service, I want the exiting items to be flushed and bind the newly retrieved data to the same list. How can I achieve this? ...