Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridView Problem
 

DataGridView Problem

I have a DataGridView to display Cattle Movements (Movement Type: In, Out, and Dead). The grid is readonly and I have a separate form to edit the data. The reson that I used a separate form for editing is that I have a second Sale Type combo-box that is dependent on the Movement Type chosen, and a thrid Contact one that is dependent upon the Movement Type and Contact Type. If I filter the binding sources that the grid uses for its comb-boxes directly I get column value is not in the dataset message, so I use separate binding sources boubd to the same dataset to pass to the edit form that can be filtered.

The first problem I encounted was that if you chose the first Contact in the filtered list on the edit form when you closed it the grid combo-box would display the first Contact in the unfiltered list. I got around this by saving the dataset values, removing the filters, and then reapplying the values. This sets the values displayed in the grid correctly, except for that after editing the record if I scroll up and down therecords in the grid the values in the Sale Type and Contact combo-boxes displayed in the grid change all on their own to other values. Sometimes it seem to use the value from the record that it has just scrolled from, but other times it seems to be completly random as to what the vaues get changed to. As the grid is read-only I cannot work out how to stop it from reassigning the values displayed in the combo-boxes all on its own.

Has anyone else had this problem? Is there a solution?
AndrooC  Friday, August 07, 2009 6:27 AM

Hi,

Unfortunately, I am not able to reproduce the value has been changed when scroll. Could you show us the code or providing us a demo project to test? This will make the issue more clearly. Please upload your demo project to some server and offer us the URL. Skydrive (http://skydrive.live.com/ ) may be a good option. You can sign up 25GB free space only with your Windows Live Passport.

By the way, there is some information about filter:

Something like:

27 How do I have a combo box column display a sub set of data based upon the value of a different combo box column?

Look forward to your replay.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Wednesday, August 12, 2009 8:37 AM

We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Monday, August 17, 2009 1:57 AM

You can use google to search for other answers

Custom Search

More Threads

• Converting a datagridview cell value to an integer
• Datagridview - generic display
• datagrid displaying '+' sign
• Setup Problem!
• DataGrid Text
• Cell value while in edit mode datagridview
• Simple yet annoying question about DataGridViewTextBoxColumn
• datagridviewcombobox - value
• How do I hide the location bar in a pop up window using window.showModalDialog?
• gridview add empty row with tab