//this happens off the UI thread static void VendorSearchOnExecute(VendorSearchArgs state) { // ReSharper disable InconsistentNaming using (var Vendor_Search = new Proc("Vendor_Search")) // ReSharper restore InconsistentNaming state.ResultTable = Vendor_Search.AssignValues(state.Values).ExecuteDataSet(state).Tables[0]; }
//this happens off the UI thread void VendorSearchOnExecute(VendorSearchArgs state) { using (Proc Vendor_Search = new Proc("Vendor_Search")) { Vendor_Search.AssignValues(state.values); state.resultTable = Vendor_Search.ExecuteDataTable(state); } }
void VendorSearchOnCompleted(VendorSearchArgs state) { if (state.Success) { grdVendorList.ItemsSource = state.resultTable.DefaultView; //grdVendorList.Columns[grdVendorList.Columns.Count - 1].Visibility = Visibility.Hidden; //hide ShortDescription //grdVendorList.Columns[grdVendorList.Columns.Count - 2].Visibility = Visibility.Hidden; //hide VendorID } else { lblVendorSearchError.Text = state.Text; } }
void VendorSearchOnCompleted(VendorSearchArgs state) { if (state.Success) { lbxVendorList.ItemsSource = state.ResultTable.DefaultView; //lbxVendorList.Columns[lbxVendorList.Columns.Count - 1].Visibility = Visibility.Hidden; //hide ShortDescription //lbxVendorList.Columns[lbxVendorList.Columns.Count - 2].Visibility = Visibility.Hidden; //hide VendorID if (lbxVendorList.Items.Count > 0) { Dispatcher.BeginInvoke((Action)(() => { ((ListBoxItem)lbxVendorList.ItemContainerGenerator.ContainerFromIndex(0)) .Focus(); lbxVendorList.SelectedIndex = 0; }), System.Windows.Threading.DispatcherPriority.ContextIdle); } } else { lblVendorSearchError.Text = state.Text; } }
void VendorSearchOnCompleted(VendorSearchArgs state) { if (state.Success) { lbxVendorList.ItemsSource = state.ResultTable.DefaultView; //lbxVendorList.Columns[lbxVendorList.Columns.Count - 1].Visibility = Visibility.Hidden; //hide ShortDescription //lbxVendorList.Columns[lbxVendorList.Columns.Count - 2].Visibility = Visibility.Hidden; //hide VendorID if (lbxVendorList.Items.Count > 0) { Dispatcher.BeginInvoke((Action)(() => { ((ListBoxItem) lbxVendorList.ItemContainerGenerator.ContainerFromIndex(0)) .Focus(); lbxVendorList.SelectedIndex = 0; }), System.Windows.Threading.DispatcherPriority.ContextIdle); } } else lblVendorSearchError.Text = state.Text; }
void VendorSearchOnCompleted(VendorSearchArgs state) { if (state.Success) { grdVendorList.ItemsSource = state.resultTable.DefaultView; //grdVendorList.Columns[grdVendorList.Columns.Count - 1].Visibility = Visibility.Hidden; //hide ShortDescription //grdVendorList.Columns[grdVendorList.Columns.Count - 2].Visibility = Visibility.Hidden; //hide VendorID } else lblVendorSearchError.Text = state.Text; }