![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | RE: Data error DataGridView DataGridViewComboBoxColumn I am having a problem now with a 3rd column. When I select a value the combo below the one that I was working with looses it display and a data error occurs. I have forwarded you the example with the 3rd column added "Linda Liu[MSFT]" wrote: Quote: > Hi John, > > Thank you for your reply! I'm glad to hear that you have solved the > problem. > > In fact, since you didn't demonstrate the structure of the TerritoriesTable > explicitly in the sample project( you filled the datatable from your > database but I didn't have the database on my hand), I didn't find out the > real reason that caused your problem. > > But I did realize that an exception will be thrown when a > DataGridViewComboBoxColumn is bound and a cell under this column is set to > a value that is not in the item collection. > > In addition, I work out how to implement a cascade comboboxes in a > DataGridView. Hope this is also helpful to you. > > If you have any other question in the future, please don't hesitate to > contact us. It's always our pleasure to be of assistance! > > Sincerely, > Linda Liu > Microsoft Online Community Support > > |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Data error DataGridView DataGridViewComboBoxColumn Hi John, There's something wrong with my user account these two days so that I cannot receive any email sent to my company email box. Please send your example to my another email address: liuting_lliu@xxxxxx. Thank you and I look forward to your reply! Sincerely, Linda Liu Microsoft Online Community Support |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Data error DataGridView DataGridViewComboBoxColumn I sent the zip file to both of your emails. Did you recieve it? "Linda Liu" wrote: Quote: > Hi John, > > There's something wrong with my user account these two days so that I cannot > receive any email sent to my company email box. > > Please send your example to my another email address: > liuting_lliu@xxxxxx. > > Thank you and I look forward to your reply! > > Sincerely, > Linda Liu > Microsoft Online Community Support > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Data error DataGridView DataGridViewComboBoxColumn Hi John, Yes, I have received your sample project. I have run it on my machine and did see the problem on my side. After doing some research, I found that this problem is caused by setting the DataSource property of the col3ChoicesBS and the filteredcol3ChoicesBS components to a DataTable, rather than a DataSet. When the DataSource property of two BindingSource components are set to a same DataTable, they are sharing the same copy of the DataTable. That is, if you do a filter on one BindingSource component, the other BindingSource component will reproduce the same result. However, if the DataSource property of the two BindingSource components are set to a DataSet and the DataMember property of them are set to a table within it, the two BindingSource components are NOT sharing the same copy of the data source. Doing a filter on one BindingSource component won't affect the other BindingSource component. So the workaround of your problem is to create a DataSet and add the m_Col3Choices to this DataSet. The next step is to set the DataSource property of the col3ChoicesBS and the filteredcol3ChoicesBS components to this DataSet and the DataMember property to the Col3Choices table. For example: void FilterByCell_Load(object sender, EventArgs e) { ... DataSet col3Choices = new DataSet(); col3Choices.Tables.Add(m_Col3Choices); col3ChoicesBS.DataSource = col3Choices; // assume that the table name is "Col3ChoicesTable" col3ChoicesBS.DataMember = "Col3ChoicesTable"; filteredcol3ChoicesBS.DataSource = col3Choices; filteredcol3ChoicesBS.DataMember = "Col3ChoicesTable"; ... } Hope this helps. If you have any question, please feel free to let me know. Sincerely, Linda Liu Microsoft Online Community Support |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| error: Unable to update public free/busy data. An error occurred while attempting to open the | Vista mail | |||
| DataGridView new row | .NET General | |||
| Re: datagridview | .NET General | |||
| Data Fetching and system.windows.forms.form & .datagridview | PowerShell | |||
| Install Error - Required data was not placed into memory error | Vista installation & setup | |||