By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

DataBinding & Table Events

P: n/a
Hi,

I'm having issues with DataBinding. I have a Form with two data bound comboboxes on it. When you select something in one combobox I may {or may not} want to change the selected item in the other combobox. For reasons beyond the scope of this post I need to change the second comboboxe's selected index from within a ColumnChanging event handler. So, inside a ColumnChanging event handler I change the value of the column that is bound to the second combobox. This is not working well at all; it appears that the column that is bound to the second combobox does change but the GUI does not update the combobox to reflect the change. I'm not quite certain where the issue is -other than that it is a DataBinding issue- so I have several questions:

1) Both comboboxes represent a DayOfWeek {ComboBox.Items collection has Sun, Mon, ... Sat} and so are being stored on disk as an integer in the range 0-6. What combobox property should I bind the DataColumn to - SelectedIndex? SelectedValue? If SelectedValue then what do I need to do with ValueMember and how do I keep SelectedValue set to the correct value?

2) What can I "legally" do inside of RowChanging and ColumnChanging events? Is it legal for me to change the value of another column on the same DataRow from within a ColumnChanging event? Can I remove the target row from within a RowChanging event?
--Richard
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.