ComboBox in DataGrid Cell, bombs when changing rows with arrow keys

  • Thread starter Thread starter Charlie@CBFC
  • Start date Start date
C

Charlie@CBFC

Hi:

I have implemented a class taken from msdn website that inserts a combobox
into a grid cell and binds the value property to a column. It works except
that when changing rows using arrow keys it will bomb when a combobox is in
edit mode. I get error saying current row number doesn't match currency
manager, but when inspecting in debugger it does. Has anyone come accross
this?

Thanks,
Charlie
 
Charlie,

Charlie@CBFC said:
Hi:

I have implemented a class taken from msdn website that inserts a combobox
into a grid cell and binds the value property to a column. It works
except
that when changing rows using arrow keys it will bomb when a combobox is
in
edit mode. I get error saying current row number doesn't match currency
manager, but when inspecting in debugger it does. Has anyone come accross
this?

Thanks,
Charlie


Before calling SetColumnValueAtRow in your SetColumnValueAtRow override,
check whether your cached row number equals the CurrencyManager's position.
If not, don't call SetColumnValueAtRow.

Hope this helps,
Tom T.
 
Thanks! I just forced currency manager = row number where error occurred.
It worked, but will try your idea too. Looking forward to switching to new
grid in 2.0.

Charlie
 
Back
Top