• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.DataGridViewCellValueEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.DataGridViewCellValueEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewCellValueEventArgs类的具体用法?C# DataGridViewCellValueEventArgs怎么用?C# DataGridViewCellValueEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataGridViewCellValueEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewCellValueEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: dgMyDesigner_CellValueNeeded

 private void dgMyDesigner_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     for (int i = 0; i < totalRecords; i++)
     {
         if (e.RowIndex == i)
         {
             string employeeId = Convert.ToString(dgMyDesigner.Rows[e.RowIndex].Cells[0].Value);
             if (e.ColumnIndex == 1)
             {
                 e.Value = empManager.GetGroupNameByEmployeeId(employeeId);
             }
             if (e.ColumnIndex == 2)
             {
                 e.Value = empManager.GetEmployeeById(employeeId).Name;
             }
             if (e.ColumnIndex == 3)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.OnChatting);
             }
             if (e.ColumnIndex == 4)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.Signed);
             }
             if (e.ColumnIndex == 5)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.NotSigned);
             }
             if (e.ColumnIndex == 6)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.Denied);
             }
         }
     }
 }
开发者ID:huaminglee,项目名称:DeeHome,代码行数:34,代码来源:MyDesigner.cs


示例2: DatabaseGridView_CellValueNeeded

 private void DatabaseGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex == 0)
     {
         e.Value = e.RowIndex + 1;
     }
 }
开发者ID:raman-kashyap,项目名称:Practices,代码行数:7,代码来源:DatabaseListView2.cs


示例3: dgVisitContent_CellValueNeeded

 private void dgVisitContent_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         e.Value = e.RowIndex + 1;//set serial number of the table rows.
     }
 }
开发者ID:huaminglee,项目名称:DeeHome,代码行数:7,代码来源:DisplayVisitContent.cs


示例4: dataGridView1_CellValueNeeded

 private void dataGridView1_CellValueNeeded(object sender,
     DataGridViewCellValueEventArgs e)
 {
     if (store.ContainsKey(e.RowIndex))
     {
         // Use the store if the e value has been modified 
         // and stored.            
         e.Value = store[e.RowIndex];
     }
     else if (newRowNeeded && e.RowIndex == numberOfRows)
     {
         if (dataGridView1.IsCurrentCellInEditMode)
         {
             e.Value = initialValue;
         }
         else
         {
             // Show a blank value if the cursor is just resting
             // on the last row.
             e.Value = String.Empty;
         }
     }
     else
     {
         e.Value = e.RowIndex;
     }
 }
开发者ID:ariesy,项目名称:Sirius.DataGridViewVirtualModeDemo,代码行数:27,代码来源:VirtualModeDemo.cs


示例5: dgMySuordinate_CellValueNeeded

 private void dgMySuordinate_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     for (int i = 0; i < totalRecords; i++)
     {
         if (e.RowIndex == i)
         {
             string employeeId = Convert.ToString(dgMySuordinate.Rows[e.RowIndex].Cells[0].Value);
             if (e.ColumnIndex == 2)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.OnChatting);
             }
             if (e.ColumnIndex == 3)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Signed);
             }
             if (e.ColumnIndex == 4)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.NotSigned);
             }
             if (e.ColumnIndex == 5)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Denied);
             }
             if (e.ColumnIndex == 6)
             {
                 e.Value = orderManager.GetLastMonthToCurrentMonthCountByOrderStatus(employeeId, OrderStatus.OnChatting);
             }
         }
     }
 }
开发者ID:huaminglee,项目名称:DeeHome,代码行数:30,代码来源:BusinessStatisticsForDesign.cs


示例6: dgUnSubordinate_CellValueNeeded

 private void dgUnSubordinate_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         e.Value = (pageIndex - 1) * pageSize + e.RowIndex + 1;//set serial number of the table rows.
     }
 }
开发者ID:huaminglee,项目名称:DeeHome,代码行数:7,代码来源:UnSubordinateInformationAssistantList.cs


示例7: Watch_CellValueNeeded

 private void Watch_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     switch (e.ColumnIndex)
     {
         case 0: e.Value = "Variable"; break;
         case 1: e.Value = "3.14159 mV"; break;
         case 2: e.Value = "0x00000000"; break;
         case 3: e.Value = "100 ms"; break;
     }
 }
开发者ID:BuFran,项目名称:OpenInsider-gui,代码行数:10,代码来源:frmMain.cs


示例8: dataGridView1_CellValueNeeded

 private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     //this function will populate unbound grid row and column wise. debug it then u can understand how grid is populating.
     e.Value = memoryCache.RetrieveElement(e.RowIndex, e.ColumnIndex);
     //if (e.RowIndex == 14)
     //{
     //    //here it populated all rows of the grid
     //    //label1.Text = "Data loading completed";
     //}
 }
开发者ID:tridipkolkata,项目名称:SampleRepo,代码行数:10,代码来源:GridWithXMLFile.cs


示例9: dataGridView_CellValueNeeded

        private void dataGridView_CellValueNeeded( object sender, DataGridViewCellValueEventArgs e )
        {
            if( pointList == null  )
                throw new InvalidOperationException( "cell value needed but point list is null" );

            if( e.ColumnIndex == 0 )
                e.Value = pointList[e.RowIndex].X;
            else
                e.Value = pointList[e.RowIndex].Y;
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:10,代码来源:DataPointTableForm.cs


示例10: OnCellValueNeeded

 protected override void OnCellValueNeeded(DataGridViewCellValueEventArgs e)
 {
     base.OnCellValueNeeded(e);
     IList list = this.DataSource as IList;
     int index = e.RowIndex;
     if (list == null) { return; }
     if (index < 0 || (index+1) > list.Count) { return; }
     if (e.ColumnIndex == 0 )
     {
         e.Value = IsItemSelected(list[index]);
     }
 }
开发者ID:FMSC-Measurements,项目名称:Cruise-Design,代码行数:12,代码来源:SelectedItemsGridView.cs


示例11: dataGrid_CellValueNeeded

        // -----------------------------------------
        // DataGrid Events
        // read from internal ArrayList
        public virtual void dataGrid_CellValueNeeded(DataGridView dg, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex < dlist.Count)
            {
                cBaseItem d = (cBaseItem)dlist[e.RowIndex];
                e.Value = d.RenderCell(e.ColumnIndex);
            } else {
                // if displaying new row
                if (current_editrow != null)
                {
                    cBaseItem d = current_editrow;
                    e.Value = d.RenderCell(e.ColumnIndex);
                }

            }
        }
开发者ID:jstty,项目名称:OlderProjects,代码行数:19,代码来源:cDBItemList.cs


示例12: dataPaymentInfo_CellValueNeeded

 private void dataPaymentInfo_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     Payment c = paymentInfo[e.RowIndex];
     if (e.ColumnIndex == 2)
     {
         int i = 0;
         for (; i < goodsInfo.Length; i++)
         {
             if (goodsInfo[i].Id == c.GoodsId)
             {
                 e.Value = goodsInfo[i].Name;
                 break;
             }
         }
         if (i == goodsInfo.Length) e.Value = "无";
     }
 }
开发者ID:kevinfyc,项目名称:yoga,代码行数:17,代码来源:frmPaymentMgr.cs


示例13: dgvTemplates_CellValueNeeded

 private void dgvTemplates_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     if (e.RowIndex >= 0 && e.RowIndex < templates.Count)
     {
         switch(e.ColumnIndex)
         {
             case 0:
                 e.Value = e.RowIndex;
                 break;
             case 1:
                 e.Value = templates[e.RowIndex].name;
                 break;
             case 2:
                 e.Value = templates[e.RowIndex].preferredAngleNoMore90;
                 break;
         }
     }
 }
开发者ID:Lapa-Alya,项目名称:SearchOfHouseNumbers,代码行数:18,代码来源:TemplateEditor.cs


示例14: GetCellContentFromPoint

		public CellContent GetCellContentFromPoint(int x, int y)
		{
			HitTestInfo hit = HitTest(x, y);
			if (hit.Type == DataGridViewHitTestType.Cell)
			{
				DataGridViewCellValueEventArgs args = new DataGridViewCellValueEventArgs(hit.ColumnIndex, hit.RowIndex);
				OnCellValueNeeded(args);
				for (int i = 0; i < this.ColumnCount; ++i)
				{
					Rectangle r = this.GetColumnDisplayRectangle(i, false);
					if (x > r.Left && x < r.Right)
					{
						return new CellContent(args.Value as string, r.Left);
					}
				}
			}
			return null;
		}
开发者ID:gspatace,项目名称:logexpert,代码行数:18,代码来源:BufferedDataGridView.cs


示例15: dgIAList_CellValueNeeded

 private void dgIAList_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     for (int i = 0; i < totalRecords; i++)
     {
         if (e.RowIndex == i)
         {
             string employeeId = Convert.ToString(dgMySuordinate.Rows[e.RowIndex].Cells[0].Value);
             if (e.ColumnIndex == 1)
             {
                 e.Value = i + 1;
             }
             if (e.ColumnIndex == 3)
             {
                 e.Value = mySubordinateManager.GetVisitCount(employeeId);
             }
             if (e.ColumnIndex == 4)
             {
                 e.Value = mySubordinateManager.GetInformationAssistantCount(employeeId);
             }
             if (e.ColumnIndex == 5)
             {
                 e.Value = mySubordinateManager.GetCustomerCount(employeeId);
             }
             if (e.ColumnIndex == 6)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.OnChatting);
             }
             if (e.ColumnIndex == 7)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Signed);
             }
             if (e.ColumnIndex == 8)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.NotSigned);
             }
             if (e.ColumnIndex == 9)
             {
                 e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Denied);
             }
         }
     }
 }
开发者ID:huaminglee,项目名称:DeeHome,代码行数:42,代码来源:MySubordinate.cs


示例16: dataGridView1_CellValueNeeded

        private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            // Check if the item is in the local cache.
            DataRow match = null;           
            if (dtCachedItems != null)
                match = dtCachedItems.Rows.Find(e.RowIndex + 1);

            if (match == null)
            {
                // The item isn't in memory.
                // Get a new range of 100 records.
                int from, to;
                if (e.RowIndex < 50)
                    from = 0;
                else
                    from = (e.RowIndex - 50);

                to = from + 100;
                dtCachedItems = NorthwindDB.GetOrders(from, to);

                // Don't use the MessageBox to show this information.
                // Hiding any part of the ListView can retrigger this event.
                lblStatus.Text = String.Format(
                    "Fetched rows from {0} to {1} at {2}.",
                    from.ToString(), to.ToString(),
                    DateTime.Now.ToLongTimeString());

                match = dtCachedItems.Rows.Find(e.RowIndex + 1);
            }

            switch (e.ColumnIndex)
            {
                case 0:
                    e.Value = match["OrderID"];
                    break;
                case 1:
                    e.Value = match["ShippedDate"];
                    break;
            }           

        }
开发者ID:ehershey,项目名称:development,代码行数:41,代码来源:Form1.cs


示例17: dataGridView1_CellValueNeeded

        void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            try
            {
                if (e.RowIndex >= dt.Rows.Count)
                    return;
                if (e.ColumnIndex >= dt.Columns.Count)
                    return;

                if (dt.Rows[e.RowIndex][e.ColumnIndex] == null || dt.Rows[e.RowIndex][e.ColumnIndex] is DBNull)
                {
                    e.Value = "null";
                    return;
                }

                Type dtype = dt.Columns[e.ColumnIndex].DataType;

                if (dtype == typeof(byte[]))
                {
                    e.Value = "blob/byte[]";
                }
                else if (dtype == typeof(DateTime))
                {
                    e.Value = ((DateTime)dt.Rows[e.RowIndex][e.ColumnIndex]).ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    e.Value = dt.Rows[e.RowIndex][e.ColumnIndex] + "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error has occured.\r\n\r\n" + ex.ToString());
                this.Close();
            }
        }
开发者ID:njmube,项目名称:Mysqlbackup.net,代码行数:36,代码来源:FormQueryBrowser2.cs


示例18: cellValueNeeded

        private void cellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex >= records.Count)
            {
                e.Value = string.Empty;
                return;
            }

            switch (dgViewLog.Columns[e.ColumnIndex].Name)
            {
                case "timeColumn":
                    e.Value = records[e.RowIndex].Time;
                    break;
                case "typeColumn":
                    e.Value = records[e.RowIndex].Type;

                    if ((string)e.Value == exceptionText)
                    {
                        dgViewLog.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red;
                        dgViewLog.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.White;
                    }
                    else
                    {
                        if ((string)e.Value == errorText)
                        {
                            dgViewLog.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.DarkRed;
                            dgViewLog.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.White;
                        }
                        else
                        {
                            if ((string)e.Value == completedText)
                            {
                                dgViewLog.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Green;
                                dgViewLog.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.White;
                            }
                            else
                            {
                                if ((string)e.Value == summaryText)
                                {
                                    dgViewLog.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.DarkSlateBlue;
                                    dgViewLog.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.White;
                                }
                            }
                        }
                    }

                    break;
                case "detailColumn":
                    e.Value = records[e.RowIndex].Detail;
                    break;
                default:
                    break;
            }

            dgViewLog.Rows[e.RowIndex].Height = 16;
        }
开发者ID:esurharun,项目名称:TSDumper,代码行数:56,代码来源:ViewLogControl.cs


示例19: grdSamples_CellValueNeeded

        private void grdSamples_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex == -1) return;

            var sampleModel = GetSampleModelByIndex(e.RowIndex);

            if (sampleModel == null) e.Value = "";
            else if (e.ColumnIndex == 0)
            {
                e.Value = sampleModel.Description;
            }
            else if (e.ColumnIndex == 1)
            {
                e.Value = sampleModel.Bpm.ToString("0.00");
            }
        }
开发者ID:jasonhighet,项目名称:Halloumi.Shuffler,代码行数:16,代码来源:SamplesControl.cs


示例20: dataGridView1_CellValueNeeded

 private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
 {
     try
     {
         e.Value = m_dtCSV.DefaultView[e.RowIndex][e.ColumnIndex].ToString();
     }
     catch { }
 }
开发者ID:klonage,项目名称:nlt-gcs,代码行数:8,代码来源:LogBrowse.cs



注:本文中的System.Windows.Forms.DataGridViewCellValueEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.DataGridViewCheckBoxCell类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DataGridViewCellValidatingEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap