Custom Data Sources in the Combox program and custom in the combox Program
There is a combox control named cbxPutStatus. in the program, manually define the data source for it and bind it
Privatevoid POrderSplitFrm_Load (object sender, EventArgs e)
{
// Bind order status
This. cbxPutStatus. DataSource = ableableforputstatus ();
This. cbxPutStatus. DisplayMember = "PutStatusString ";
This. cbxPutStatus. ValueMember = "POrderApproveStatus ";
This. cbxPutStatus. SelectedIndex = 0
}
PrivateDataTable DataTableForPutStatus ()
{
DataTable dt = newDataTable ();
Dt. Columns. Add ("PutStatusString ");
Dt. Columns. Add ("POrderApproveStatus ");
// Define the order status 0: unpublished; 1: published; 2: All statuses
Dt. LoadDataRow (newobject [] {"to be released", "0"}, true );
Dt. LoadDataRow (newobject [] {"published", "1"}, true );
Dt. LoadDataRow (newobject [] {"All statuses", "2"}, true );
Return dt;
}