Click here to Skip to main content
15,912,021 members

Comments by Mohammed Abul-Haija (Top 1 by date)

Mohammed Abul-Haija 12-Nov-11 16:09pm View    
////* Initialization *////
//=====================//
this.yEAR_NAMEComboBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.sTUDY_YEARBindingSource, "YEAR_NAME", true));
this.yEAR_NAMEComboBox.DataSource = this.sTUDY_YEARBindingSource;
this.yEAR_NAMEComboBox.DisplayMember = "YEAR_NAME";
this.yEAR_NAMEComboBox.Font = new System.Drawing.Font("Traditional Arabic", 14.25F, System.Drawing.FontStyle.Bold);
this.yEAR_NAMEComboBox.ForeColor = System.Drawing.Color.Red;
this.yEAR_NAMEComboBox.FormattingEnabled = true;
this.yEAR_NAMEComboBox.Location = new System.Drawing.Point(242, 52);
this.yEAR_NAMEComboBox.Name = "yEAR_NAMEComboBox";
this.yEAR_NAMEComboBox.Size = new System.Drawing.Size(121, 37);
this.yEAR_NAMEComboBox.TabIndex = 2;
this.yEAR_NAMEComboBox.ValueMember = "YEAR_NAME";

////* Form Load *////
//================//
this.sTUDY_YEARTableAdapter.Fill(this.MyDataSet.STUDY_YEAR);
============================================================

This Code at run-time fill the ComboBox with These Data:
2011/2012
2012/2013
2013/2014
2014/2015
2015/2016
.... etc.

When I select f.g 2012/2013 (second choice), the label of first choice changed from 2011/2012 to 2012/2013. Also, When I choose f.g 2014/2015 (fourth choice) after that the label of first choice changed again to 2014/2015 and the second choice also changed to 2014/2015 label also and go on .... .