/// <summary> /// In Barcode /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItemPrinterBarcode_ItemClick(object sender, ItemClickEventArgs e) { var products = new List <Product>(); foreach (var rowHandle in gridView1.GetSelectedRows()) { var productId = gridView1.GetRowCellValue(rowHandle, "ProductID"); Product product = _productService.GetProductById(productId.ToString()); products.Add(product); } using (var report = new ReportBarcode()) { report.DataSource = products; report.Landscape = true; var tool = new ReportPrintTool(report); tool.PreviewForm.FormClosing += new FormClosingEventHandler(ReportCartonLabels_FormClosing); //_waitDialog.CloseWait(); report.ShowPreviewDialog(); } //var rows = new DataRow[gridView1.SelectedRowsCount]; //for (int i = 0; i < gridView1.SelectedRowsCount; i++) //{ // //rows[i] = gridView1.GetDataRow(gridView1.GetSelectedRows()[i]); // XtraMessageBox.Show(i); //} ////gridView1.BeginSort(); ////try ////{ //// foreach (DataRow row in rows) //// row.GetFocusedRowCellValue("ProductID") ////} ////finally ////{ //// gridView1.EndSort(); ////} }
/// <summary> /// In Barcode /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItemPrinterBarcode_ItemClick(object sender, ItemClickEventArgs e) { var products = new List<Product>(); foreach (var rowHandle in gridView1.GetSelectedRows()) { var productId = gridView1.GetRowCellValue(rowHandle, "ProductID"); Product product = _productService.GetProductById(productId.ToString()); products.Add(product); } using (var report = new ReportBarcode()) { report.DataSource = products; report.Landscape = true; var tool = new ReportPrintTool(report); tool.PreviewForm.FormClosing += new FormClosingEventHandler(ReportCartonLabels_FormClosing); //_waitDialog.CloseWait(); report.ShowPreviewDialog(); } //var rows = new DataRow[gridView1.SelectedRowsCount]; //for (int i = 0; i < gridView1.SelectedRowsCount; i++) //{ // //rows[i] = gridView1.GetDataRow(gridView1.GetSelectedRows()[i]); // XtraMessageBox.Show(i); //} ////gridView1.BeginSort(); ////try ////{ //// foreach (DataRow row in rows) //// row.GetFocusedRowCellValue("ProductID") ////} ////finally ////{ //// gridView1.EndSort(); ////} }