Long time.. A lot of distractions. I have been interested in a lot new things. With Windows Phone, Robotics coming into picture, the hobbies and pass-times all changed around.
But to get back on the track.. Here is a very small piece of information that I am sure would help a lot of people.
I encountered the above error while working with a Combobox in a Windows Application.
This would come up every time the form loads and the the SelectedValue of the combobox was selected.
This normally would occur to comboboxes, which are databound.
So here is the problem and the solution.
This is how we usually bind the combobox to data
cboBox.DataSource = data_set.Tables["table_name"].DefaultView;
cboBox.DisplayMember = "field_name";
cboBox.ValueMember = "field_id";
Instead, to resolve this issue all we need to do is first specify the DisplayMember and ValueMember and then Bind.
cboBox.DisplayMember = "field_name";
cboBox.ValueMember = "field_id";
cboBox.DataSource = data_set.Tables["table_name"].DefaultView;
Thank u very much
ReplyDeletethank u soooo ver much man!!!!
ReplyDeletebut y does this happen!?
hi,
ReplyDeleteBut I have one Question, If first combo box have 8 value then 8 times fire selectedindexchanged event. Why?
thanks alooooooooooooooooooooooooooooooooooooooooooooooooot dear
ReplyDeleteYou gave me amazing solution thanks a lot!!!
ReplyDeleteThanks alot.......
ReplyDelete