Groups | Blog | Home


Archived Months
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
all groups > dotnet windows forms databinding > january 2006

Filter by week: 1 2 3 4 5

How do I handle exceptions that are thrown during a move method of the BindingNavigator?
Posted by A.M-SG at 1/31/2006 4:07:50 PM
I found a problem in BindingNavigator that perhaps questions its usefulness in big/multi-module applications. For example, the BindingNavigator is bound to a BindingSource that is based on a DataTable that has a required column. If that required column is DBNull when the BindingNavigat...more >>


How can I find the BindingSource has some changed data
Posted by A.M-SG at 1/31/2006 2:49:20 PM
Hi, In my WinForms application, I have a set of controls that are bound to a BindingSource control. When the user closes the form, I need to ask him if he wants to save data. The problem is I cannot find anyway to check if the value of any textboxes is changed! Obviously checking Dat...more >>

Relation between two binding comboboxes
Posted by Luis Rodriguez at 1/31/2006 12:00:00 AM
Hi everybody! I have a Master Details Form with typed dataset. The master have two combobox. (First ComboBox is connect with a country field and the second is connect with the city field) The problem is that when I move the record position, the country change and the cities's combobox sh...more >>

HELP: Insert a row? (Strange Behavior on DataTable.Rows.Insert )
Posted by RRB at 1/30/2006 5:39:48 AM
Hello, I have a datagrid for which I need to allow users to insert rows upon pressing insert. The datagrid is nothing fancy beyond having a special calculated value column for line number (And I only fire that event after a row addition, insertion, or deletion) and some other calculations (...more >>

DataView - RowFilter: Wrong Values
Posted by Viktor at 1/29/2006 12:00:00 AM
Hi, I have a little problem in my app with DataView and I'm unable to find a solution myself. I couldn't find anything on msdn or google, so I really hope someone can explain. My app consists partly of databound controls and partly of controls I fill manually, based on a dataview (al...more >>

Databinding between two forms in .NET 2.0
Posted by Henrik Skak Pedersen at 1/28/2006 11:02:31 PM
Hi, I would like to data bind two different forms with each other. I would like to have employees on the first form and orders on the second. When the selected employee changes, the orders should change two. It is easy to do on a single form where you can add a new bindsource which points to t...more >>

Make Simple Binding to Control/Class Property Two-way?
Posted by rlg at 1/27/2006 5:22:24 AM
We're using C# in VS 2005. We've successfully bound a DataGridView to a collection of Widget objects using the generic BindingList<Widget>, and the binding is 2-way. I also understand we could have used another collection mechanism and implemented IBindingList. Now we've bound a TextBox's ...more >>

problem with deleting from dataset
Posted by Vaidas Gudas at 1/26/2006 3:56:14 PM
I have datalist, which dataosurce it is to dataset table, user by bindingsource control I am filling dataset with table adapter. I want delete from dataset table the row, which I am selected in datalist. Now I am using Me.CallRegistrationDataSet.Klausimai.Rows(Me.lstKlausimai.SelectedIndex...more >>



Combo bound to a related table loses binding upon delete.
Posted by Emma Middlebrook at 1/26/2006 4:50:50 AM
Hi, I have an application working quite happily until I attempt to delete a row from a datagrid. I have a datagrid that is bound to a table with book details. In my UI I also have various controls that allow you to edit the row being displayed in the datagrid. My datagrid is just being used...more >>

DataGridView ComboBox Strange Behaviour.
Posted by Andrew Burns at 1/25/2006 3:11:57 PM
I will attempt to be as brief as possible while still providing the most accurate details. I have a DGV that is bound to a binding source (which it's self is bound to a BO). In my DGV I have a combo column that is the part number. I have done the EditingControlShowing and all that.... I hav...more >>

Problem with Databinding TextBox Visible=False
Posted by Luis Rodriguez at 1/25/2006 12:00:00 AM
Hi everybody! I need assign information in a textbox with Visible=False, this control has binding with a typed dataset. When I save, the value of the control is null and if I change Visible=True, works fine. What happened here? I don't know what I can do. I want to assign the value in th...more >>

DataGridView - Select Row based on ID column
Posted by Phil Williams at 1/25/2006 12:00:00 AM
Hello, This should be easy! I have a DataGridView and I want to select the row where the QuestionID (Column1) = 5 What is the code to do this??? My DataGridView is bound to a TableAdapter Thanks in advance. Phil ...more >>

Newbie Binding TextBox to Database
Posted by AAJ at 1/23/2006 11:39:23 AM
Hi all I initailly assumed a bound textbox to be one that looks after updating a data source on its own (similar to MS access bound forms, drag it on the form and off it goes). How wrong I seem to have been. In VS2005 seems a bit more complicated than that, DataSets, DataAdapters etc. bu...more >>

Can you bind a comboBox in the navigation panel?
Posted by wjobes NO[at]SPAM newsgroups.nospam at 1/22/2006 6:15:46 AM
I have tried with this code, but, unsuccessfully. this.tscboName.ComboBox.DataSource = this.instructorsBindingSource; this.tscboName.ComboBox.DataBindings.Add("DisplayMember", this.instructorsBindingSource, "InstructorName"); this.tscboName.ComboBox.DataBindings.Add("ValueMember", this.in...more >>

Databinding combobox to enum.
Posted by Paul Brown paul_dot_brown_at_twi_dot_couk at 1/21/2006 7:12:55 PM
Can someone tell me whether I'm missing something really obvious here or not I have the following dummy class class eclass { public enum Waves { longitudinal=0, torsional=1, both = 2 } private Waves m_wavemode; public Waves Wavemode { ...more >>

Error with datagridview and bindingnavigator with typed dataset
Posted by Luis Rodriguez at 1/19/2006 7:51:32 AM
Hi everybody! I maked a project with a Master and Child Table. with datagridview and bindingnavigator control. The problem is: When I click a deleteitem button and after click the save button, I have the next error: Concurrency violation: the DeleteCommand affected 0 of the expecte...more >>

lazy load DataGridView - is there a Navigation event?
Posted by Ed West at 1/18/2006 10:30:16 PM
Hi, I would like to lazy load a datagridview - on a datarow, when they click on the expand + symbol, is there a way to catch that event? that way, I can fill the datarows in the related table. Thanks, Ed...more >>

shared, read-only data
Posted by at 1/18/2006 5:54:34 PM
Hi, NG! Is there any way to share DataTable "definitions" across multiple DataSets in the DataSet designer? To make it more clear I need to have a "master" DataSet that contains unrelated tables (that are read-only at runtime, reference lists...) At runtime an instance of this DataSet will be ...more >>

DataBinding textbox to datatable
Posted by Faraz.Haque NO[at]SPAM gmail.com at 1/18/2006 5:13:44 PM
I am struggling with a databinding issue. Essentially, i have a bunch of text boxes that are I have bided to the currentrecord of a datable. I initially use beginedit on the row when loading the form. My issue is that when i programatically change the value of that column of the current datarow,...more >>

bound combo box not displaying correct record when first loading
Posted by Phil Williams at 1/18/2006 11:26:20 AM
Hello all, I have a combo box and have it bound to my 2 recordsets. This is working well, BUT when I open the form the combo box does not display the correct corresponding record (from the lookup recordset). ie. the comboboxes record CustomerRegionID=2 and my lookup table contains the foll...more >>

DataGridView and BindingNavigator
Posted by smalolepszy at 1/18/2006 12:45:11 AM
How can I connect this dwo controls. I found the example how can I connect BindingNavigator and two TextBox, but how I can use this mechanism in DataGridView? private void LoadData() { // The xml to bind to. string xml = @"<US><states>" + @"<state><name>Washington</name><ca...more >>

Master Details problem with delete command
Posted by Antoni Gomez at 1/17/2006 11:38:50 AM
Hi every body! I'm working with VS2005 and SQL Server 2005. I maked a typed dataset with two datatables (Master-Details) with his relations between them. The indexes are primary keys with autoincrement. The relation have the "Both Relation And Foreign Key Constraint" with Update Cascad...more >>

How to convert a selectedIndex to SelectedValue for ComboBox
Posted by Mark L. Breen at 1/16/2006 4:37:42 PM
Hello All, I have a selected index for a combo, which I percieve to be the best value to use when programitically maniplating combos. What I want to be able to do is retrieve the Selected Value for a given Selected Index It may be just me, but I have found the whole selected value, sele...more >>

Validation problems
Posted by g18c NO[at]SPAM hotmail.com at 1/15/2006 1:46:50 PM
Hi, i have recently been able to code my desired app, a DataGridView which doesnt allow new items to be added. Instead i have a subform which shows the object details. So, there is an 'add new' button which sets the edit forms BindingSource to the main forms BindingSource, i then call AddNew on ...more >>

Can i retrieve all properties in a class to copy one object to another?
Posted by Michael.Suarez NO[at]SPAM gmail.com at 1/13/2006 10:08:50 AM
Basically I want to do something like this (psuedo-code): you have: MyClass MyObject; which is instantiated in the form load. You have a copy function: { MyClass MyObjectCopy = new MyClass(id); foreach (property p in MyClass.properties) { MyObject.p = MyObjectCopy.p; } ...more >>

URGENT..... Master Details problem autoincrement
Posted by Antoni Gomez at 1/12/2006 2:18:58 PM
Hi everybody ! I'm working with VS2005 and SQL Server 2005. I maked a typed dataset with two datatables (Master-Details) with his relations between them. The indexes are primary keys with autoincrement. The relation have the "Both Relation And Foreign Key Constraint" with Updat...more >>

Refreshing a BindingSource object
Posted by Rick Strahl [MVP] at 1/12/2006 1:59:15 AM
Hi all, I have a couple user controls on a form that have a Value property that I want to bind. I added a Value property and marked it as Bindable, then hooked it up in the designer. Inbound binding works just fine as does simple outbound binding. However, I'm having some odd issues wit...more >>

Summary of my experience with combo box, any further suggestions ?
Posted by Mark L. Breen at 1/11/2006 5:06:01 PM
Hello All, I have been playing with a combo box for the last day or so, attempting to get my head around the best or the recommended way to update them. I had problems setting the .Text and also the .SelectedValue and also the ..SelectedText. Following comments and suggestions on the news...more >>

DataGridView, add items via dialog not through grid
Posted by g18c NO[at]SPAM hotmail.com at 1/11/2006 10:24:17 AM
Hi, i have managed to bind my strongly typed container list of TestTypes to a DataGridView and i am able to add new items to the list by clicking on the asterix line (*) at the bottom of the grid. What i would like to do however is have a popup menu when i right click on the grid with an AddNe...more >>

using datagridview for fast input
Posted by Elhanan at 1/11/2006 9:44:23 AM
hi all.. i wanna create a small windowsforms application where a user will read a barcode, and this barcode will be entered into multiple cells in the grid. i wanna make sure that when a cell is filled the next cell will be automtically selected, and so on untill the last cell, and when tha...more >>

How to re-acquire the Text from a combo box
Posted by Mark L. Breen at 1/10/2006 3:29:13 PM
Hello Guys and Galls, I use combos on my forms. The code to initialise the combos is as follows Dim dsPIDTypes As DataSet dsPIDTypes = PartDB.GetPIDTypes ' Returns a dataset object cboPIDType.DataSource = dsPIDTypes cboPIDType.DisplayMember = "tlkpPIDType...more >>

Inheriting from Control to use DataBinding
Posted by Michael.Suarez NO[at]SPAM gmail.com at 1/10/2006 8:29:52 AM
Suppose I have a class that inherits from Control: public class MyClass: Control { private string text1; public string MyText1 { get{return text1;} set{text1 = value;} } public MyClass() { text1 = new String(); } } Let's suppose I have a textbox and a ...more >>

bind windows form control to typed dataset
Posted by danielsanberger NO[at]SPAM googlemail.com at 1/10/2006 7:57:52 AM
Hi all, I am sorry, but I cannot make it to create a Databinding. Can anyone help me? I have a Form and put a label on it. I created a typed dataset by an xsd. In Design-Time I did a databinding for the label to a property of a typed row. DataSource Update Mode is "OnValidation". Now I bui...more >>

BindingContext Navigation Problem
Posted by Yossi And Inbar at 1/9/2006 11:49:50 PM
Hi , I am trying to do master-child relation. the lines like : this.BindingContext[dsView,"Customers"].Position = 2 or this.BindingContext[dsView,"Customers"].Position = 3 when i am write one of them after the relation code, it's works, but after that i cant move the position. i am...more >>

BindingContext problem
Posted by Yossi And Inbar at 1/9/2006 10:21:40 PM
Hi, I am using VS2003 C# and i am trying to do relations between two tables. its work, but i have a very big problem with the position. i want to click on a row in the datagrid and get the childs at the other grid. when i am write : this.BindingContext[dsView,"Customers"].Position = 2 or...more >>

Binding class properties to controls with cancel to prevent editing
Posted by g18c NO[at]SPAM hotmail.com at 1/9/2006 11:49:16 AM
Hi, i am very new to data binding and am a little confused! I have some properties in a class which i would like the user to be able to edit. I can bind these fields to a control and then show the form, the user can edit the data in the text boxes and the class's data members get set ok withou...more >>

Parent-Child Report?
Posted by David Veeneman at 1/9/2006 6:27:57 AM
How do I create a parent-child report for the new VS 2005 ReportViewer control? I can't find any documenation on how to set up the report once the data set is built. I know how to create a flat report with grouping, but that won't work in my case. I'd like to do a true hierarchical report. ...more >>

Turn off initial cell selection?
Posted by David Veeneman at 1/6/2006 5:56:56 PM
I have a Windows Form with a bound dataGridView control. When the form loads, the top left cell of the dgv control is highlighted. Is there a simple way to turn this highlighting off, so that no cells are highlighted when the form first loads? Thanks in advance -- David Veeneman Foresigh...more >>

Databinding custom collections
Posted by David Veeneman at 1/5/2006 7:12:33 PM
Is there any way to databind on a property-of-a-property of a collection? I'm dealing with a complex problem for which I have created an object model. Here is a drastically simplified illustration of my issue: Let's say I have a collection of Widgets that is derived from BindingList<T>. Each ...more >>

Datagridview - Change yyyymmdd to mm/dd/yyyy
Posted by rob at 1/5/2006 11:17:34 AM
I have a class that among others exposes a string property "Date". The date in this property is stored in the form yyyymmdd. Now I do the following 1) Generate a DataGridViewTextBoxColumn column for that property 2) Add the column to the datagridview 3) Populate a BindingSource by adding all ...more >>

Problem with allowing to view different part of dataSet from different child forms.
Posted by Vladimir.Sakharuk NO[at]SPAM gmail.com at 1/5/2006 8:54:19 AM
I have MDI application. On start up I have cache some data used in different child forms in DataSet. Then I create several instances of the same form that shows different part of the same table in this DataSet in DataGrid depend on selection Like Cusomer=A, Customer=B. I use the same code to fil...more >>

Many data source tables
Posted by JimH at 1/5/2006 7:31:02 AM
I’m working on converting an enterprise application to VB in Visual Studio 2005. The application has over 200 tables stored in SQL server. The problem is if I add the tables as data sources in one or more typed DataSets the development environment slows to a crawl. My goal is to get the t...more >>

Persisting changes to a bound custom collection?
Posted by David Veeneman at 1/4/2006 4:45:09 PM
What is the best event to use to capture a row change that has been committed by a DataGridView? My application uses custom collections derived from BindingList<T>. I have bound these collections to DataGridView controls, using BindingSource controls. Persisting new rows added to the grid ...more >>

Exception when updating data with simple databinding
Posted by Jeff Roush at 1/4/2006 12:22:50 PM
I'm seeing an exception when I try to use simple databinding in Visual Studio 2005. I see the exception if I create a SQL Server database file and bind a DataGridView control to it. I can view data and add new rows, but if I try to edit an existing row's data, I get an exception as soon as...more >>

How can i release memory?
Posted by kurtulus at 1/3/2006 11:22:19 PM
Hi, I create a big DataTable on a form. Its size is approximatally 100MB. I dispose this table. But memory is not released. What can i do? DataTable dt = new DataTable(); //Memory Usage 30MB for(int i = 0; i < 300000; i++) { dt.Rows.Add(new object[] {'123','123','123','123','123','...more >>

Deleting a bound DataGridView row?
Posted by Michael Wong at 1/3/2006 8:57:51 PM
I have a DataGridView which is bound to a dataset. When I delete rows from the DataGridView, should it delete the same rows from the dataset also? I have tried the following code, but apparently, the dataset isn't updated. Did I miss (understood) something? for(int i = 0; i < dataGridView...more >>

Combobox: Urgent help requires
Posted by mf_sina at 1/2/2006 1:19:41 PM
Hi! I appreciate if someone could tell me how can i overcome this problem with combobox in VB .Net. I use an access database (CUSTOMERS.MDB) as database for my application. database has 2 tables as follows: 1) TblCustomers ( Cust_ID , Cust_Name , Cust_State) 2) TblStates ( State_ID , State)...more >>

DataSource property for a custom control
Posted by Jaime Stuardo at 1/2/2006 4:30:03 AM
Hi all.. I am programming a custom control inherited from System.Windows.Forms.TreeView. I have added one property named DataSource whose behaviour is identical as the one present in DataGridView control, both at design time and at run time. In properties view at design time, the DataSo...more >>


DevelopmentNow Blog