Windows Forms Data Controls and Databinding - Windows Forms
Recent update: 2008-3-21

DataGridView binding to another control

476 byte By TheNetStriker at 2008-3-7
I have a problem databinding my child DataGridView to my master DataGridView. When I simply add two DataGridView's then its no problem, I can select a record on the master table and get the child records in the other DataGridView.But now I like to have my child DataGridView in another control, ...

Databinding problem

953 byte By yaakov at 2008-3-6
Hi everybody.I have a form which contains a user control.When the form loads, I'm populating some DataSet, and assigning the dataset refernece to one of the control properties.The control contains other control that are bound to various paths on that dataset, adding new rows, modifying, ...

Data binding to a listbox

1571 byte By Christopher11 at 2008-3-5
Hello. I am a beginner. I am using Visual studio 2005 (B2) to create a user interface that contains a list box, data navigator and several text boxes that are bound to two relational tables (Investors and ContactDetail). Investor ID is the primary key in the Investors table and has a type of ...

Object Data Source Binding - Forms vs Web

2157 byte By MichaelOberhardt at 2008-3-3
I've had a search through the forum for an answer to this, or a similar question, as well as MSDN, but no luck, so am creating a new post.I have created asp.net forms in vs2005 using object data sources, and was pretty impressed how flexible they were, and you had the ability to map operations ...

Binding to RichTextBox

1171 byte By BobHeitzman at 2008-3-1
Using VS 2005 Beta 2, VB, SQL Server 2000I have an existing SQL table with a field 'Comments' of SQL datatype 'text'. The data stored in the field was created using the RichTextBox under VB6.I use a Data Source/Data Set and set the Comments field to RichTextBox. When I drag the control onto ...

Clearing a Formatted DataGridView

576 byte By KhalidMirza at 2008-2-28
When I try to clear controls and DataviewGrid from a panel which has bound data, it takes several seconds to do it, when I have this lineGridHandle.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsIf Comment this line then it clears fast. If comment the above line then it clears ...

Advice requested: Windows Forms Binding:

2042 byte By RussellMangel at 2008-2-27
I have been trying to get the following Windows Forms binding working, without success.The following Code, successfully populates the GridControl, and both combo boxes with data. The two comboBoxes represent: SalesOrderType, and SalesOrderStatus. There six SalesOrderTypes, and five ...

How can I disable tooltip on a button column in a datagridview?

449 byte By Rick at 2008-2-27
I have a windows form with a datagridview. The first column is a bound column of type DataGridViewButtonColumn. the button shows the value of the column as its text. Everything works as intended. The problem is that a tooltip is displayed when hovering over the button showing the same text that appe...

DataBinding memory leak in Windows Forms 1.1

503 byte By RussellMangel at 2008-2-26
I am currently writing a Windows Forms Application using Beta 2 in C#.I will be using data binding.I understand that the .net framework 1.1 has a memory leak http://support.microsoft.com/default.aspx?scid=kb;en-us;813137Has this memory leak been resolved in the new 2.0 Framework?ThanksRussell ...

VS 2005 CheckBox bound to SQL Server 2000

760 byte By BobHeitzman at 2008-2-25
Using VS 2005 beta 2. I did a drag and drop of a data source table that points to an existing SQL Server 2000 table. I want to use a chekbox with a few fields. They are defined as smallint and have nulls, 0, and 1 in the exisitng data. The chekboxs show up OK on the form in IDE but at runtime ...

Databing a grid with web service object

226 byte By santanu at 2008-2-24
I was using a datagrid binding it with a web service object, i was just wondering whether it is better to bind a grid with the webservice object directly or using certain datasets to bind the datagrid to the webservice object.

Grid and BindingSource object change

500 byte By Brent_One at 2008-2-23
I was working thru an excellant example by Robert Green of Microsoft entitled Walkthrough: Smart Client Data in Visual Basic 2005. This was for Visual Studio 2005 beta 1. Using beta 2 there seems to be a significant change. When I worked thru this example the DataConnector object has been ...

Bound Checkbox and SQL datatypes

418 byte By BobHeitzman at 2008-2-22
I have a Windows form that was created by dropping a data source. One field was set to create a checkbox control. The SQL field is SmallInt with 0's and 1's. If I run the form and click on the checkbox the program hangs. I can stop the program from the IDE. 1) This appears to be a bug 2) Is ...

JIT

9580 byte By PeterSpanien at 2008-2-22
I have tried to bind som data to at windows form from sqlserver 2000 in th new visual studio 2005 beta. It works ok but when I try to change the data a window displays saying unhandeld exception has occurred...Update requires a valid updatecommand when passed DataRow collection with modified ...

Databinding from outside a library

721 byte By viliescu at 2008-2-21
In the project I am working on I did some databinding on custom objects and on application settings. Because I want to separate the domain model from the view, the custom objects are in the model and the databinding is happening in the view. The domain model has also defined some application ...

Combobox Usage VS2003 -> VS2005

996 byte By GarthK at 2008-2-20
I need to populate a C# Combobox with potentially several thousand items. I know this is not recommended but this is after horiz data splitting so it's the best I can do. In VS2003, I tried binding to a dataset but this was way too slow so I started loading the Itemlist from a datareader and ...

Binding to a struct

556 byte By viliescu at 2008-2-20
Hello, I have noticed if I use a custom struct instead of a class as a data source for a binding source I cannot get the changes back ( if I write (CustomStruct)customStructBindingSource.DataSource I'm getting a struct with no changed values ).I presume this is because for structs, asignment ...

Can I bind DataGridView to my objects?

1776 byte By SpurryMoses at 2008-2-20
Hi, Are there any scenarios that describe how to bind a DataGridView to your own Objects? I've been to this useful website and there are no examples for this scenario: http://msdn2.microsoft.com/library/k39d6s23(en-us,vs.80).aspx) I have a class that represents my data record - say it's a ...

Sorting an unbound column

270 byte By Gravy at 2008-2-19
Hi, I have a DataGridView bound to a bindingSource, it also contains an unbound calculated column. I have found that sorting isn't supported on the unbound column. Is there a way I can perform my own sorting for this particular column? Thanks for your help Graham

Example for deriving from datagridviewcell

880 byte By TAS at 2008-2-18
I designed a user control that can be described as an enhanced combobox. It has more than just a dropdown button right besides the text field and offers much more functionalty. Because deriving from a combobox isn't very flexible it's derived from a user control and contains a textbox and ...

DataGridView unbound column not updated.

916 byte By Gravy at 2008-2-17
Hi,I'm binding to a set of data using the BindingSource control and a DataGridView. In the data I have various that contain enum values the need looking up for there text descriptions.What I descided to do was to create an unbound column and respond to the CellFormatting event on the DGV; in ...

Child table foreign key not being updated

618 byte By Brady at 2008-2-17
I have a DocumentTable and DocumentLineTable in a DataSet. They are linked by a FK relation on DocumentID, the primary key of the DocumentTable. I have a TexBox for DocumentDesc, bound to a docTableBindingSource, and a DataGridView bound to a docLineBindingSource. This docLineBindingSource has docTa...

DataGridView Cell Formatting

2050 byte By Paulvo at 2008-2-16
Hello, I developed a small win forms application in VS 2005 Beta 1 (which runs perfectly) and recently converted it to Beta 2 and I am seeing strange behavior with formatting of a dataGridView.I'm trying to find out if this is a bug or not.After programmatically adding a datatable to the ...

SqlDataReader problem

2250 byte By HristoSerafimov at 2008-2-15
Hello All,I'm using .NET Visual Studio 2003 C# and SQL 2000.I have strange problem using SqlDataReader.I'm using SqlDataReader in for cycle (from 0 to 99 in example bellow) to get data from SQL 2000 database in transaction. The SQL command executes reader on a Stored Procedure (which is ...

Can't leave a bound combobox after deleting its content

1062 byte By TAS at 2008-2-15
I have a combobox (dropdown) that contains something that was loaded from a database. The selectedvalue of the combobox is bound to a typed dataset. The database's column that is displayed by the combobox allows null values. If I select the combobox text and delete it I'm not able to leave ...

Custom formatter

446 byte By viliescu at 2008-2-15
I have to do databinding to a custom object. This custom object has an int property which must be databinded to a textbox with a special format (it's for chess squares, so 0 means "a1", 1 means "a2" , ... , 63 means "h8"). And the databinding must be two-way (editing the textbox will update ...

Combobox problem

664 byte By CodeScribler at 2008-2-15
Hi All,I have a combobox and a text box. They are both databound to different fields of a datatable. The combobox contains a list of telephone number descriptions eg. Home, Mobile, Work. When an item is selected the appropriate number is displayed in the text box.When I call AddNew the textbox ...

DataGridView Full Row select

348 byte By Gravy at 2008-2-15
Hi,A real quick question...I'm using a DataGridView to show a list of record from a business collection. I want full row select (like a listview) and I want a double click to open the selected item. Am I best responding to the CellDoubleClick event the checking to make sure the user didn't ...

Cascaded PropertyChangedEvents crashes with DataGridView

939 byte By GerdSauermann at 2008-2-14
Bug or not? we wanted to show different properties of objects of a BindingList in a DataGridView. Some of the properties had to change their values depending on the values of other properties. Therefore we introduced a new BindingList with an event handler 'ChildObjectChanged', that is raised ...

Problem with combobox and databound datagridview

1543 byte By LawrenceSutton at 2008-2-14
HiI have a datagridview that is databound to a table via a bindingsource and a DataGridViewComboBox column that is bound to a second table (both in the same dataset). I am dynamically adding the column to the grid. Dim viewcol As New DataGridViewComboBoxColumnviewcol.DataSource = ...

Stop selecting in Datagridview

735 byte By WongJunnKit at 2008-2-13
Facing a problem and not sure it can be solve or not. And my english is a bit weak, hope you still able to understand what i am trying to tell.In my program there are 2 main portion, left part is a treeview, right part is a datagridview. I want to implement drag and drop from datagridview's ...

Using XSD schema for field validation when databinding to XML

1269 byte By eddwo at 2008-2-13
I'd like to create an application, part of which involves the customer creating XML documents compliant with a government standard schema. Much of the data will be filled in automatically, but parts will be manually entered by the customer.For the customer data, I want to create a few simple ...

Have I accidentally created multiple currency managers?

748 byte By CodeScribler at 2008-2-12
Hi All,Ref: VS 2003I have a two datetimepickers which show the arrival and departure date. I also have two navigation buttons to go through the different arrival and departure dates in the dataset. There is also a lable that show the current position of the total number of dates. That all works ...

Problem with RowChanging event

3544 byte By ManniAT at 2008-2-11
Hi,if have a DataSet (SQLExpress) whith 2 Tables.On one table I add a RowChanging event handler.When I add a record in a boud datagridview then an exception occures in the handler. (After changing the postion in the DGV the event is fired).Here my handler:void PCs_RowChanging(object sender, ...

Log Shipping

1036 byte By EricEarle at 2008-2-10
Hi, Im a engineer really suffering and would beg for some kind of help on a log shipping issue. Im getting the following error msg when doing log shipping: Microsoft SQL-DMO (ODBC SQLState:42000) Error 14261: The specified @name ('Log Shipping copy for NIMMAIN.vanxdb_logshipping') already ...

How to show a different text for bool

818 byte By ManniAT at 2008-2-10
Hi,is there a simple way to display a different text on a bool-bound text.Assume I have an app with a label showing some bool value from an SQL-Table.This shows True or False - what I want is to show (for an example) Yes / No, or 1 / 0 on "Out off office" / "In the office".Another "problem" is ...

How to show a different text for bool (reverse bind)

818 byte By ManniAT at 2008-2-8
Hi,is there a simple way to display a different text on a bool-bound text.Assume I have an app with a label showing some bool value from an SQL-Table.This shows True or False - what I want is to show (for an example) Yes / No, or 1 / 0 on "Out off office" / "In the office".Another "problem" is ...

use generic collection as datasource?

393 byte By Zaph0d at 2008-2-8
I have a generic dictionary of my custom class and want to use it as a listbox datasource. Is this possible?Actually, I don't really have to use it as a datasource if this is not possible. My custom class is an item in a listbox and combobox. If I change the description property in my class, ...

Binding on ComboBox.SelectedValue - no Format-Event sent

5218 byte By Ed_G at 2008-2-7
Hi all,I've got a problem trying to bind on SelectedValue of a ComboBox - if a value of the field in the DataRow is DBNull the ComboBox show empty. But I want it to show a 'no selection'-Item that I added to the DataTable especially for that.I've tried to do it adding ConvertEventHandler on ...

Databinding to a ToolStripStatusLabel

346 byte By viliescu at 2008-2-7
Hi, Why there is no databindings for ToolStripStatusLabel? I need to add a databinding to it, like a regular label allows databinding for its text. I know StatusStrip can be databinded, but I cannot use this solution (I need a StatusStrip with 3 labels, each of them databinded to different ...

Listview Databinding to a either a datatable or business object how?

321 byte By vbjunkie at 2008-2-7
Hi,I know that databinding has largely improved in vs2005.However I cannot seem to put together a databindingListview.Could somebody help me with an example how to do it.thanks a ...

One record from a datatable into two rows in a datagrid view

209 byte By frgu at 2008-2-7
How can it be achieved to display one record from a datatable into two rows in a datagridview. I've seen this example in the MSDN Windows Forms on Tour, where the outlook userinterface was rebuilt in .NET.

Copy value from one datagrid to another datagrid using windows application in c#

372 byte By Vasu at 2008-2-6
Hi friends! I am developing one project in windows application using c#.In that project i have two datagrid.One datagrid have values from database.Anotherone is empty in the same page.If i am selecting one vrow in first datagrid means it comes to second datagrid one one by one.How can i do it?I will...

Problem with combobox in datagridview

1112 byte By frgu at 2008-2-6
When using combobox columns in a datagridview, I've encountered the following problems:1. I'm working with a datagridview which contains a databound combobox. The edit mode of the cells = EditOnEnter. When I select a comboboxcell for which no value has been selected yet, and I try to sort the ...

AddNew dont work...(for me at least)

960 byte By CodeScribler at 2008-2-6
Hi All, I have the following line of code on a form of mine: Me.BindingContext(dsBookings, "Bookings.BookingDates").EndCurrentEdit() Me.BindingContext(dsBookings, "Bookings.BookingDates").AddNew() Now the result of the following is correct: Me.BindingContext(dsBookings, ...

Combobox Databinding - First item not binding properly?

1283 byte By guest at 2008-2-6
Hello,I have a series of comboboxes collected in a user control that are populated by a datatable. Essentially it's a stripped down query editor, so the first combobox is the available fields. Then when the field is selected, the next combobox should list available operators for the field, and t...

binding combobox.text not compatible with arrow keys?

756 byte By Zaph0d at 2008-2-5
I have a combobox manually filled with a couple of items. I want to bind the combo to a dataset to store the value selected. As there is no datasource for the combo and no valuemember set, I am binding to the text property rather than the selectedvalue. Is this right?Whilst this works fine when ...

DataBinding Combos

3533 byte By ClarkeScott at 2008-2-5
Hi All, Hope someone can help me out. I have a winform with user details (textboxes, combos etc). I bind the textboxes to a dataset containing contact data. The combos are set to a reference dataset as the data source and bound to the contacts dataset. Like this… ...

autocomplete AND dropdownlist combobox

670 byte By Zaph0d at 2008-2-4
I want to give the user the functionality of the autocomplete, allowing them to enter one or more letters and receive a list of possible entries, whilst also ensuring that the user can only select an item from the list and not type any old thing. I know that I cannot use the dropdownlist list ...

TableAdapter Update Error

3003 byte By dida at 2008-2-4
I made a TableAdapter and use ObjectSource to bind it to GridView, when I insert new rows it works OK, but when I try to Update or Delete it gives me this error: ObjectDataSource 'RegionObject' could not find a non-generic method 'Update' that has parameters: RegionDescription, ...