Exemplo n.º 1
0
        public FrmView(string filter)
        {
            InitializeComponent();
            SmLib.SysFunc.LoadIcon(this);

            dsHdm = StartUp.GetHdb(filter);
            GrdBrowse.DataSource   = dsHdm.Tables[0].DefaultView;
            GrdBrowseCt.DataSource = dsHdm.Tables[1].DefaultView;

            //PH
            FieldLayout GrdLayoutPH = SysFunc.CreateFieldLayout(StartUp.SysObj, GrdBrowse, StartUp.stringBrowse3, dsHdm.Tables[0]);

            GrdBrowse.FieldLayouts.Add(GrdLayoutPH);
            SysFunc.CreateSumFieldList(StartUp.SysObj, GrdBrowse, StartUp.stringBrowse3);

            //CT
            FieldLayout GrdLayoutCT = SysFunc.CreateFieldLayout(StartUp.SysObj, GrdBrowseCt, StartUp.stringBrowse4, dsHdm.Tables[1]);

            GrdBrowseCt.FieldLayouts.Add(GrdLayoutCT);
            SysFunc.CreateSumFieldList(StartUp.SysObj, GrdBrowseCt, StartUp.stringBrowse4);

            this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
            {
                if (GrdBrowse.Records.Count > 0)
                {
                    GrdBrowse.ActiveRecord = GrdBrowse.Records[0];
                }
            }));
        }