J
John Sitka
Winforms
DataTable comboBoxsaleordersData = new DataTable();
comboBoxsaleordersData.Columns.Add("salesorder", typeof(string));
DataRow drow;
cn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
if ( rdr != null)
{
while (rdr.Read())
{
// insert rows/values to DataTable comboBoxsaleordersData
drow = comboBoxsaleordersData.NewRow();
drow[0] = Convert.ToString(rdr["fsono"]);
comboBoxsaleordersData.Rows.Add(drow);
//at the same time build the combobox
comboBoxsaleorders.Items.Add(rdr["fsono"]);
}
}
comboBoxsaleorders.SelectedIndex = 0;
rdr.Close();
Behavior desired...
In the interface much of the dataentry is done from the numeric keypad.
So I need what is typed in the text part of the combo box to be validated
against comboBoxsaleordersData or the Items collection of the
comboBoxsaleorders.
Validation should occur on "enter" or "tab". Loose focus I guess.
Thanks.
DataTable comboBoxsaleordersData = new DataTable();
comboBoxsaleordersData.Columns.Add("salesorder", typeof(string));
DataRow drow;
cn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
if ( rdr != null)
{
while (rdr.Read())
{
// insert rows/values to DataTable comboBoxsaleordersData
drow = comboBoxsaleordersData.NewRow();
drow[0] = Convert.ToString(rdr["fsono"]);
comboBoxsaleordersData.Rows.Add(drow);
//at the same time build the combobox
comboBoxsaleorders.Items.Add(rdr["fsono"]);
}
}
comboBoxsaleorders.SelectedIndex = 0;
rdr.Close();
Behavior desired...
In the interface much of the dataentry is done from the numeric keypad.
So I need what is typed in the text part of the combo box to be validated
against comboBoxsaleordersData or the Items collection of the
comboBoxsaleorders.
Validation should occur on "enter" or "tab". Loose focus I guess.
Thanks.