Beispiel #1
0
        void client_RunSQLReturnTableCompleted(object sender, RunSQLReturnTableCompletedEventArgs e)
        {
            var ds = new DataSet();

            ds.FromXml(e.Result);
            foreach (DataRow dataRow in ds.Tables[0].Rows)
            {
                var flowForm = new FlowForm
                {
                    DataBaseName = string.Empty,
                    No           = dataRow["No"].ToString(),
                    Name         = dataRow["Name"].ToString(),
                    PTable       = dataRow["PTable"].ToString(),
                    Type         = formatFormType(dataRow["FrmType"]),
                    URL          = dataRow["URL"]
                };
                list.Add(flowForm);
            }

            this.Grid1.ItemsSource   = null;
            this.Grid1.ItemsSource   = list;
            this.Grid1.SelectedIndex = 0;

            //由于数据源变动,必须首先调用UpdateLayout
            this.Grid1.UpdateLayout();
            //  this.Grid1.ScrollIntoView(this.Grid1.SelectedItems[0], null);
            //  this.Grid1.ItemsSource;
            //this.Grid1.ItemsSource = list;
        }
Beispiel #2
0
        void client_RunSQLReturnTableCompleted(object sender, WF.WS.RunSQLReturnTableCompletedEventArgs e)
        {
            var ds = new DataSet();

            ds.FromXml(e.Result);
            foreach (DataRow dataRow in ds.Tables[0].Rows)
            {
                var flowForm = new FlowForm
                {
                    DataBaseName = string.Empty,
                    Id           = dataRow["No"].ToString(),
                    Name         = dataRow["Name"].ToString(),
                    TableName    = dataRow["PTable"].ToString(),
                    //Type = formatFormType(dataRow["FormType"]),
                    //URL = dataRow["URL"]
                };
                list.Add(flowForm);
            }
            this.Grid1.ItemsSource = list;
            this.Grid1.LoadingRow += new EventHandler <DataGridRowEventArgs>(gridFlowFrom_LoadingRow);
        }
Beispiel #3
0
        private void Row_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            TimeSpan    t   = DateTime.Now.TimeOfDay;
            DataGridRow dgr = sender as DataGridRow;

            if (dgr.Tag != null)
            {
                TimeSpan oldT = (TimeSpan)dgr.Tag;
                if ((t - oldT) < TimeSpan.FromMilliseconds(300))
                {
                    FlowForm ff = this.Grid1.SelectedItem as FlowForm;
                    if (ff == null)
                    {
                        return;
                    }

                    Frm frm = new Frm();
                    frm.BindFrm(ff.No);
                    frm.Show();
                }
            }
            dgr.Tag = t;
        }