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


C# DataGridView.add_Column_Link方法代码示例

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


在下文中一共展示了DataGridView.add_Column_Link方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadServicesData

		public void loadServicesData()
		{
            "Loading Services Data".info();
			this.invokeOnThread(
				()=> {
						 this.clear();
						 dataGridView = this.add_DataGridView();  
						 dataGridView.CellContentClick+= (sender,e) => 	cellClicked(e.RowIndex,e.ColumnIndex);
						 dataGridView.Columns.Clear();						 			        	 
						 
						 
						 var menu  = dataGridView.add_ContextMenu();
    		 			 menu.add_MenuItem("refresh", (menuItem) => loadServicesData());
    		 
			        	 var services = ServiceController.GetServices();
			        	 			        	
			        	 dataGridView.add_Column("Display Name");
			        	 dataGridView.add_Column("Service Name");
			        	 dataGridView.add_Column("Service Type");			        	 
			        	 dataGridView.add_Column_Link("stop service");        	
			        	 foreach(var service in services)      	 
			        	 {        	 
			        	 	if (service.CanStop)			        	 	
			        	 	{			        	 		
			        	 		var id = dataGridView.add_Row(
			        	 					 service.DisplayName,
			        	 					 service.ServiceName,			        	 					 
			        	 					 service.ServiceType,
			        	 					 "stop");								
			        	 		dataGridView.Rows[id].Tag = service;
			        	 	}	    	 		
			        	 }        	 
			        });
		}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:34,代码来源:ascx_Services_Stop.cs

示例2: ascx_Start_Tools

 	public ascx_Start_Tools()
 	{    		    	    		    		
 		dataGridView = this.add_DataGridView();
 		dataGridView.AllowUserToAddRows = true;
 		dataGridView.AllowUserToDeleteRows = true;
 		dataGridView.add_Columns(typeof(ProcessDetail));    		
 		dataGridView.add_Column_Link("Start", true);
 		dataGridView.onClick(startProcess);    		
 		dataGridView.onDrop(loadFile);
 		
 		var menu  = dataGridView.add_ContextMenu();
         menu.add_MenuItem("save", (menuItem) => saveCurrentList());
 		loadList();    		
  	}   
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:14,代码来源:ascx_Start_Tools.cs

示例3: loadProcessData

		public void loadProcessData()
		{
            "Loading Processes Data".info();
			this.invokeOnThread(
				()=> {
						 this.clear();
						 dataGridView = this.add_DataGridView();  
						 dataGridView.CellContentClick+= (sender,e) => 	cellClicked(e.RowIndex,e.ColumnIndex);
						 dataGridView.Columns.Clear();

                         var menu = dataGridView.add_ContextMenu();
                         menu.add_MenuItem("refresh", (menuItem) => loadProcessData());
                         //menu.add("close", (menuItem) => ParentForm.Close());

			        	 //dataGridView.SelectionChanged+=(sender,e)=> dataGridView.ClearSelection();
			        	 // use this to see all available properties
			        	 //foreach(var property in Processes.getCurrentProcess().type().properties())
			        	 //		dataGridView.column(property.Name,150);
			        	 dataGridView.add_Column("Name");
			        	 dataGridView.add_Column("Window Title");
			        	 dataGridView.add_Column("Id");
			        	 dataGridView.add_Column("Handle");
			        	 dataGridView.add_Column("Paged Memory Size (Mb)");
			        	 dataGridView.add_Column("Working Set (Mb)");
			        	 dataGridView.add_Column("Priority Class");
			        	 dataGridView.add_Column_Link("stop process");        	 
			        	 var megaByte = 1024*1024;
			        	 foreach(var process in Processes.getProcesses())      	 
			        	 {        	 
			        	 	var id = dataGridView.add_Row(   process.ProcessName,
							        	 					 process.MainWindowTitle,
							        	 					 process.Id,
							        	 					 process.prop("Handle"),
							        	 					 (double)process.PagedMemorySize64 / megaByte,
							        	 					 (double)process.WorkingSet64 / megaByte,
							        	 					 process.prop("PriorityClass"),
							        	 					 "stop");
			        	 	dataGridView.Rows[id].Tag = process;
			        	 
			    	 		// use this to see all available properties
			    	 		/*var rowCells = new List<object>();
			    	 		foreach(var property in process.type().properties())
			    	 			rowCells.Add(process.prop(property.Name));
			    	 		dataGridView.row(rowCells.ToArray());*/        	 		
			        	 }        	 
			        });
		}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:47,代码来源:ascx_Processes_Stop.cs


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