RptProduction_detail.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.SA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Infragistics.Win.UltraWinGrid;
  14. using Infragistics.Win;
  15. using CoreFS.CA06;
  16. using System.Net;
  17. using System.Collections;
  18. namespace Core.StlMes.Client.BuyBillet
  19. {
  20. public partial class RptProduction_detail : FrmBase
  21. {
  22. private DataTable mydate;
  23. private String myfixedcol;
  24. public RptProduction_detail(DataTable datetable,string Title,String fixedcol)
  25. {
  26. mydate = datetable;
  27. myfixedcol = fixedcol;
  28. InitializeComponent();
  29. this.Text = Title;
  30. }
  31. private void RptProduction_detail_Load(object sender, EventArgs e)
  32. {
  33. getproductions();
  34. }
  35. private void getproductions()
  36. {
  37. try
  38. {
  39. ultraGrid1.DataSource = mydate;
  40. if (myfixedcol != "")
  41. {
  42. ultraGrid1.DisplayLayout.UseFixedHeaders = true;
  43. foreach (Infragistics.Win.UltraWinGrid.UltraGridBand band in ultraGrid1.DisplayLayout.Bands)
  44. {
  45. foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn column in band.Columns)
  46. {
  47. if (column.Key != "material_no" && column.Key != "material_name")
  48. column.PerformAutoResize(Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand);
  49. if (column.Key == myfixedcol)
  50. {
  51. for (int i = column.Index; i >= 0; i--)
  52. {
  53. band.Columns[i].Header.Fixed = true;
  54. }
  55. }
  56. }
  57. }
  58. }
  59. ultraGrid1.Refresh();
  60. }
  61. catch (Exception e)
  62. {
  63. MessageBox.Show(e.Message);
  64. }
  65. finally
  66. {
  67. }
  68. }
  69. }
  70. }