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

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
 
T

TT \(Tom Tempelaere\)

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.
 
C

Charlie@CBFC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top