L
Lorenz Kahl
Hi,
I have a real serious problem I can't figure out myself. Here's the
pretty plain scenario:
I have a DataSet with one table. I created a DataView on that table.
I have a Listbox bound to the DataView to select items to display and
edit in a couple of TextBoxes. So far everything is fine.
Now I'd like to add a button that allows the user to add an item to the
list. In the event handler of the button click I call the Add()-method
of the DataView. Unfortunately nothing happens to the UI visually. The
selected item in the list stays unchanged. I can select the newly added
'empty' item manually at the bottom of the list though. But the
TextBoxes still show all the details of the last selected 'real' item.
When I press the add-button I would like to have the newly added item
(row) selected in the ListBox automatically and all the TextBoxes
blanked out. That's exactly the result that I got when I dropped the
DataView and bound all controls to the DataTable of the DataSet
directly. I just don't understand it.
But I need to use a DataView so I will be able to filter the data that
will be displayed. Oh, I might mention that there is NO RowFilter set on
the DataView (yet) that might prevent the newly added row from showing.
Can somebody please help me?! I would really appreciate it.
PS: I also already tried to use the Add()-method of the underlying
CurrencyManager. It's still the same :-(
Best regards,
Lorenz
I have a real serious problem I can't figure out myself. Here's the
pretty plain scenario:
I have a DataSet with one table. I created a DataView on that table.
I have a Listbox bound to the DataView to select items to display and
edit in a couple of TextBoxes. So far everything is fine.
Now I'd like to add a button that allows the user to add an item to the
list. In the event handler of the button click I call the Add()-method
of the DataView. Unfortunately nothing happens to the UI visually. The
selected item in the list stays unchanged. I can select the newly added
'empty' item manually at the bottom of the list though. But the
TextBoxes still show all the details of the last selected 'real' item.
When I press the add-button I would like to have the newly added item
(row) selected in the ListBox automatically and all the TextBoxes
blanked out. That's exactly the result that I got when I dropped the
DataView and bound all controls to the DataTable of the DataSet
directly. I just don't understand it.
But I need to use a DataView so I will be able to filter the data that
will be displayed. Oh, I might mention that there is NO RowFilter set on
the DataView (yet) that might prevent the newly added row from showing.
Can somebody please help me?! I would really appreciate it.
PS: I also already tried to use the Add()-method of the underlying
CurrencyManager. It's still the same :-(
Best regards,
Lorenz