当前位置: 首页>>代码示例>>C#>>正文


C# Forms.DataGridViewCellValueEventArgs类代码示例

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


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


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