I have been playing with a great sample from the FAQ 5.6 deriving a custom column style to nest a comboBox in a DataGrid column.
Everything works fine until I insert a new row into the dataset instead of adding the row (using the Rows.InsertAt() method).
The record shows up in the DataGrid but when you start clicking on other rows(or using cursor keys) to move to other rows, C# gives an invalid index message:
The Grid seems to think there is one more row than there should be - it doesn't seem to be sync'ed up with the dataset. I have seen some other similar complaints on the net but no indication of what the issue might be.
Any insight would be appreciated.
ADAdministrator Syncfusion Team October 3, 2002 07:19 AM
That sample was modified last week to handle some last row problems, so you might check to see if you have the latest version.
You might also try calling refresh on the datagrid's currency manager.
CurrencyManager cm = (CurrencyManager) this.BindingContext[this.myDataGrid.DataSource, this.myDataGrid.DataMember];
to see if that gets things back in sync.
PEPeteBOctober 3, 2002 11:37 AM
I gave it a shot but it is still giving the same exception. It seems to be in the System.Data.DataView.OnListChanged method but I can't be sure - just can't nail it down.
I have attached FAQ example 5.6 and added a button to Insert a row. If you run the sample, click on the button and then start clicking rows in the grid, you will see some interesting results.
ADAdministrator Syncfusion Team October 4, 2002 04:55 AM
We modified that sample a few days ago with a suggestion by Gerald Walsh that I think takes care of the problem you are having. We removed some code at the top of the Edit method and the entire ComboMadeCurrent method. We added a handler for SelectionChangeCommitted.
You might try getting the sample code again and trying your add button with the new code.
PEPeteBOctober 4, 2002 06:42 AM
The updated code does not seem to be there - the ComboMadeCurrent method is still there. I checked the samples in 5.6, 5.40 & 5.54. Would you have a link to it?
ADAdministrator Syncfusion Team October 4, 2002 11:20 AM
Oops. Our overnight upload from our local server has been broken for a couple of days, so the automatic upload has not been happening. I did a manual upload so you should be able to get the new files now.
PEPeteBOctober 7, 2002 11:00 AM
Well...I have tried quite a few things including;
- the new sample code
- refreshing currency manager
but it still will not work correctly. If you have any further suggestions, I would appreciate it.
If you could take a quick look...I have attached the new 5.6 example with a button to insert a row into your grid:
Run the example, click the button to insert a row
and then change the city in the combobox for each row, particularly the rows after the inserted row. Duplicate rows appear and values in the city column can get mixed up. Eventually an exception will appear. I can not explain why.