bindingsource

ErrorProvider Not Allowing Blank Date TextBox Field

Hi, I'm using the ErrorProvider in VB.Net (2005) which is associated with a BindingSource that is bound to a custom object that I have created. This custom object contains a date field that has a "Date" data type that. I am using a "TextBox" to bind the date field in my form. My issue is, whenever the TextBox loses focus and is blank...

Delete record in database with bindingnavigator

Hi I navigate with a bindingnavigator threw a datagridview. this datagridview is connected with a database. If I want to delete a row on the datagridview then it deletes it perfectly, But the row in the database stays. private void deletetoolStripButton_Click(object sender, EventArgs e) { if (MessageBox.Show("Delete recor...

Why Browsable attribute makes property not bindable?

Hi, I'm trying to use System.Windows.Forms.PropertyGrid. To make a property not visible in this grid one should use BrowsableAttribute set to false. But adding this attribute makes the property not bindable. Example: Create a new Windows Forms project, and drop a TextBox and PropertyGrid onto Form1. Using the code below, the width of...

How to fetch the selected row in a bindingsource.

How to fetch the selected row in a bindingsource. I thought this was the solution: DataRow row = ((DataRowView)bindingSource1.Current).Row; But I still get the whole datagridview If I stand on 'row' open the tree while I'm running my application I can select the Itemarray and see the selected data. but dont know how the change ...

Binding a nested object to a usercontrol results in a VERY unresponsive control when using OnPropertyChanged Bindings

I have 2 classes that implement the same interface,A Client And a Spouse Both implement IClientBase,but client actually implements IClient(which extends IClientBase a little bit further),Spouse only inherits from IClientBase. A client class,contains a spouse. I have built a few usercontrols and used databinding so i can bind the client o...

vb.net BindingSource.Find ?

Anyway to use BS.Find with more than one column (like "ID",1 And "Name","Smith") ? ...

VB.NET How iterate through a BindingSource

I have a BindingSource bound to a DataTable. I use the BS Filter and would like to iterate the filtered dataset of the DataTable using the Bindingsource. I know I can do a MoveFirst and the MoveNext and each time using the BS.Position get the correct row in the underlying DataTable. But how do I know when the sets ends? I'm sure there ...

Help with vb.et and BindingSource / DataTable/

I have a DataSet.DataTable based on a StoredProcedure. I connect it to a BindingSouce BS = New BindingSource BS.DataSource = DSCustomerPossibleRoutes BS.DataMember = "CustomerPossibleRoute" I then set a filter on the BS BS.Filter = "DayOfWeek=" & CType(DaysDates.DayOfWeek(DateTimePicker2.Value), String) BS.ResetBindings(True) Now I c...

Reassign textbox.text on bindingsource currentitem change event

I am just learning bindingsources etc. I have added my textbox databindings like so: txtTitle.DataBindings.Add("Text", bindingNavigator1.BindingSource.Current, "Title"); When the user clicks the next button on the navigator do I have to handle the bindingsource currentitem changed event to say txtTitle.Text = ((MyObject)bindingsourc...

Cast Bindingsoure.Current to POCO

I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that. When I look at the type of Bindingsoure.Current its a DataRecordInternal. How can I cast that to my POCO? Will I have to manually work out which fields in the Current object relate to my POCO. I could do it through my POCO and just tak...

Crystal report with binding source

I am new to crystal reports. I have a form with a binding source bind to the invoice table. I want to generate invoice report when the user selects an invoice record from the datagridview and clicks generate report. What i want is how can i set the report's source to the binding source can i do this using the crystal report generatin...

Set DataContext of a textbox to the current class in silverlight

Hi, i have a textbox in a UserControl, i created a property in the UserControl, i want to bind the textbox text property to the property created in the usercontrol. The problem is that i dont know how to especify the datacontext to the current class in XAML. Any idea?? thanks ...

BindingSource / BindingNavigator: How to prevent editing of bound DataSource?

I created a Data Source with VB.NET and Visual Studio 2005. I dragged the data source onto my dialog, and VS created the text boxes with the members of my linked Object, a System.Windows.Forms.BindingSource and a System.Windows.Forms.BindingNavigator. I populate the List (called myList), set myList as the DataSource in the BindingSourc...

Windows DataGridView BindingSource Index out of range exception

Scenario: Basically i have a System.Windows.Forms.DataGridView A class that inherits BindingSource and IBindingList A class that has 2 standard List as private properties DataGridView dgv = new ... MyBindingSource bindingSource = new ... MyList list = new ... The DataGridView.DataSource property gets set to the BindingSource and...

Can my binding source tell me if a change has occurred?

I have a BindingSource that I'm using in winforms data binding and I'd like to have some sort of prompt for when the user attempts to close the form after they've made changes to the data. A sort of "Are you sure you want to exit without saving changes?" I'm aware that I can do this via the BindingSource's CurrencyManager.ItemChanged e...

Help with Find() in the BindingSource

I use this to look for values in my DataGridView: private void fndBtn_Click(object sender, EventArgs e) { BindingSource src = new BindingSource(); src.DataSource = dataGridView1.DataSource; src.Position = src.Find("p_Name", textBox1.Text); } But I've two issues. First when I look fo...

WPF IsReadOnly property Binding

Hello there. Is there any way I can bind some datacontext's property value to the IsReadOnly property? e.g: <toolkit:DataGridTemplateColumn Header="MyColumn" Width="160" IsReadOnly="{Binding Path=BooleanPropertyFromMyViewModel, Converter={StaticResource InvertBoolConv}}"/> Or should I create a DataTrigger? ...

DataBinding: ComboBox.Text not updating when SelectedValue changes?

This is the relevant designer code for the ComboBox: Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Enabled", Me.RegistrationBindingSource, "IsRegistered", True)) Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.RegistrationBindingSource, "ProbationID", True)) Me.Probati...

How to bind a List of a DataObject to a Grid with BindingSources?

In an assembly I created a class like the following: [DataObject(true)] public class A { public int Foo{get;set;} [DataObjectMethod[DataObjectMethodType.Select)] public static List<A> GetAllA(string ConnectionString) { // return filled List<A> } } Now I want to display this List with a Gridcontrol under Winforms. I though of...

Problem using Binding Source with Relations in C#

Hi All, I am creating a C# winform in DOt Net 3.5, I have a datagridview control & a few Other Controls (2 Textbox). In my DataSet there are two tables MasterParent(Code) ,MasterDetail(ParentCode). Both are related by a FkRelation. Code is an AutoIncrementing Column. I Create a binding source (b1) & set Mastertable as a DataSource to i...