コード例 #1
0
        protected virtual void OnCellValueNeeded(GridViewCellValueEventArgs e)
        {
            if (this.IsSuspended)
            {
                return;
            }

            EditorControlCellValueNeededEventArgs args = new EditorControlCellValueNeededEventArgs
                                                             (e.ColumnIndex, e.RowIndex, (List <object>) this.virtualDataSource);

            if (args.RowIndex < args.VirtualDataSource.Count && args.RowIndex != -1)
            {
                object currentObject = args.VirtualDataSource[args.RowIndex];
                string columnName    = this.EditorControl.Columns[e.ColumnIndex].Name;
                if (this.typeProperties.ContainsKey(columnName))
                {
                    args.Value = this.typeProperties[columnName].GetValue(currentObject);
                }
            }

            if (this.EditorControlCellValueNeeded != null && args.VirtualDataSource.Count >= 0 && args.RowIndex != -1 &&
                args.VirtualDataSource.Count > args.RowIndex)
            {
                this.EditorControlCellValueNeeded(this, args);
            }

            e.Value = args.Value;
        }
コード例 #2
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
 void radGridView1_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.ColumnIndex < dataSource1.Columns)
     {
         OneListed info = this.dataSource1.Source[e.RowIndex];
         SetData(e, info);
     }
 }
コード例 #3
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
 void radGridView2_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.ColumnIndex < dataSource2.Columns)
     {
         OneListed info = this.dataSource2.Source[e.RowIndex];
         SetData(e, info);
         //Type type = one.GetType(); //获取类型
         //System.Reflection.PropertyInfo propertyInfo = type.GetProperty(e.Column.Name); //获取指定名称的属性
         //e.Value = propertyInfo.GetValue(one, null); //获取属性
     }
 }
コード例 #4
0
 public override object this[GridViewRowInfo row]
 {
     get
     {
         GridViewCellValueEventArgs args = new GridViewCellValueEventArgs(row, this.Column);
         this.Template.EventDispatcher.RaiseEvent <GridViewCellValueEventArgs>(EventDispatcher.CellValueNeeded, (object)this.Template, args);
         return(args.Value);
     }
     set
     {
         this.Template.EventDispatcher.RaiseEvent <GridViewCellValueEventArgs>(EventDispatcher.CellValuePushed, (object)this.Template, new GridViewCellValueEventArgs(row, this.Column)
         {
             Value = value
         });
     }
 }
コード例 #5
0
        protected override void OnCellValuePushed(object sender, GridViewCellValueEventArgs e)
        {
            if (!this.AutomaticallyPushCellValues)
            {
                base.OnCellValuePushed(sender, e);
                return;
            }

            GridViewCellValueEventArgsEx args = new GridViewCellValueEventArgsEx(e, e.ColumnIndex, e.RowIndex);

            if (this.GroupDescriptors.Count == 0)
            {
                int rowIndex = this.GetRowIndexByPage(e.RowIndex);
                this.ItemsSource.SetValue(this.ItemsSource[rowIndex], e.ColumnIndex, e.Value);
            }
            else
            {
                this.ItemsSource.SetValue(args.RowInfo.DataBoundItem, e.ColumnIndex, e.Value);
            }

            base.OnCellValuePushed(sender, args);
        }
コード例 #6
0
 public GridViewCellValueEventArgsEx(GridViewCellValueEventArgs oldArgs, int columnIndex, int rowIndex)
     : base(columnIndex, rowIndex)
 {
     this.OldArgs = oldArgs;
 }
コード例 #7
0
 /// <summary>
 /// This event controls the displayed values using VirtualMode - http://www.telerik.com/help/winforms/gridview-virtual-mode.html
 /// </summary>
 private void GridCellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     this.OnCellValueNeeded(e);
 }
コード例 #8
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
        private void SetData(GridViewCellValueEventArgs e, OneListed info)
        {
            switch (e.ColumnIndex)
            {
            case 0:
            {
                if (DataManager.Instance.LoginData != null)
                {
                    if (info.createdBy == DataManager.Instance.LoginData.id)
                    {
                        e.Value = mPaint.MCommonData.Publish;
                    }
                    else if (DataManager.Instance.WhiteEnable && DataManager.Instance.WhiteDY != null && info.publisher != null && DataManager.Instance.WhiteDY.ContainsKey(info.publisher))
                    {
                        e.Value = mPaint.MCommonData.White;
                    }
                    else if (DataManager.Instance.BlackEnable && DataManager.Instance.BlackDY != null && info.publisher != null && DataManager.Instance.BlackDY.ContainsKey(info.publisher))
                    {
                        e.Value = mPaint.MCommonData.Black;
                    }
                    else
                    {
                        e.Value = null;
                    }
                }
            }
            break;

            case 1: e.Value = info.transTypeName; break;

            case 2: e.Value = info.commLevelName; break;

            case 3:
            {
                if (string.IsNullOrWhiteSpace(info.contract))
                {
                    e.Value = "--";
                }
                else
                {
                    e.Value = info.contract;
                }
            }
            break;

            case 4:
            {
                if (string.IsNullOrWhiteSpace(info.premium))
                {
                    e.Value = "--";
                }
                else
                {
                    e.Value = info.premium;
                }
            }
            break;

            case 5:
            {
                if (info.pricingMethod == "0" && info.premium != null)
                {
                    var vvv = DataManager.Instance.GetContractLastPrice(info.contract);
                    if (vvv != null)
                    {
                        int premium;
                        int.TryParse(info.premium, out premium);
                        if (premium != 0)
                        {
                            if (info.transType == 0)
                            {
                                info.fixedPrice = (vvv.bidPrice + premium).ToString();
                            }
                            else
                            {
                                info.fixedPrice = (vvv.askPrice + premium).ToString();
                            }
                        }
                    }
                }
                decimal money;
                decimal.TryParse(info.fixedPrice, out money);
                if (money > 0)
                {
                    e.Value = string.Format("{0:C}", money);
                }
                else
                {
                    e.Value = "";
                }
            }
            break;

            case 6: e.Value = info.commAvailableQuantity; break;

            case 7:
            {
                string text = info.warehouseName;
                if (text != null && text.Length >= 6)
                {
                    text = text.Substring(0, 6) + "...";
                }
                e.Value = text;
            }
            break;

            case 8: e.Value = info.publisher; break;

            case 9: e.Value = info.remarks; break;

            case 10:
            {
                long l;
                long.TryParse(info.publisherDate, out l);
                e.Value = start.AddMilliseconds(l).ToLocalTime().ToString("HH:mm:ss");
            }
            break;

            default: break;
            }
        }
コード例 #9
0
 void radGridView1_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     e.Value = this.dataSource.Source[e.RowIndex].Data[e.ColumnIndex];
 }
コード例 #10
0
 private void RadGridView1_CellValuePushed(object sender, GridViewCellValueEventArgs e)
 {
 }
コード例 #11
0
 private void RadGridView1_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     //e.Value = this.dataSource.Rows[e.RowIndex][e.ColumnIndex].ToString();
 }