Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Strange behaviour on a datagridview
 

Strange behaviour on a datagridview

Hi all,

I am working on a reporting program which send out reports by email.

I have a datagridview which displays the IDNumber, First Name, Surname, and Email Address for a number of people.

The IDNumber field/column is a combo box in the datagrid, while the rest are text boxes.

The scenario is that I am working towards is the ability to allow multiple rows of a given IDNumber, First Name, and Surname as some people may want the report to be sent to more than one email address.

I entered some data directly into the table before making the datagridview.

No problems so far. The problems begin during the process of adding a new record.

I click on the Add button on the Binding Navigator and it gives me a new row at the bottom, no problems there.

The problem is when I select an IDNumber from the combobox, it automatically jumps to the row which contains the information for that IDNumber!

What is causing this behaviour and how can I prevent that from happening?

James Nesbitt  Wednesday, December 20, 2006 3:43 AM

Okay - got it solved!

The binding source had gone a little loopy. Couldn't see where the fault lay, maybe there was some corruption buried deep away.

The problem went away when I recreated it.

Thanks for those who helped and have been thinking about the problem!

James

James Nesbitt  Wednesday, December 20, 2006 8:41 AM

suggestion: 1.

try not set the value member of the combobox.

2. okay try that first and let know

hrubesh  Wednesday, December 20, 2006 5:29 AM

Thanks for the suggestion. I tried it and get the same result.

If I could add some complexity to this as I am also looking further down the development track.

I will also be wanting to populate the combobox list with IDNumbers from a different table. How would help solve or complicate the issue at hand?

James Nesbitt  Wednesday, December 20, 2006 5:49 AM

Okay - got it solved!

The binding source had gone a little loopy. Couldn't see where the fault lay, maybe there was some corruption buried deep away.

The problem went away when I recreated it.

Thanks for those who helped and have been thinking about the problem!

James

James Nesbitt  Wednesday, December 20, 2006 8:41 AM

Okay - the problem has returned somehow and I cannot fix it using the same method as befor, so I suspect that something else was wrong.

Any suggestions would be appreciated.

James Nesbitt  Thursday, January 11, 2007 6:52 AM

You can use google to search for other answers

Custom Search

More Threads

• How to create completly new DataGridViewCell
• How to get a string in a listbox to be shown with tabs.
• DataGridView Checkbox value issue in databind grid.
• Swap
• Deleting Rows in DataGridView
• Datagridview: is there a way to remove the focus of the first row?
• is there any solution for Concurreny Violation better than that ?
• Using DataGridView with Objects
• Save DataTable to dbf file
• databinding and custom controls