Community discussion forum

In a window application- Why the Combobox1.SelectedValue is returning null?

  • 9 months ago
    PROBLEM OCCURING INSIDE A WINDOW APPLICATION-- //Code used to fill the combobox cmbddlAgency objAgency.LoadAgencyName(); cmbddlAgency.DisplayMember = "AgencyID"; cmbddlAgency.ValueMember = "AgencyID"; foreach (DataRow dr in objAgency.AgencymasterDS.Tables["Table"].Rows) { cmbddlAgency.Items.Add(dr["AgencyName"]); } cmbddlAgency.SelectedText = "--Select--"; // I have not used dataset as datasource directly because this instruction - // cmbddlAgency.DataSource = objAgency.AgencymasterDS.Tables[0]; // firing the event combobox selected index changed and the control goes to event handler with filling only one record. // selectedvalue is coming null // this line is inside the combobox selectedindexchanged event handler. objCusRefNo.LoadCusRefNo(Convert.ToInt64(cmbddlAgency.SelectedValue));
    Post was edited on 18/02/2009 07:12:23 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback