91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 65KB
    文件類(lèi)型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-04-05
  • 語(yǔ)言: C#
  • 標(biāo)簽: C#??

資源簡(jiǎn)介

C#中實(shí)現(xiàn)一個(gè)TreeGridView(樹(shù)形表格)示例代碼C#中實(shí)現(xiàn)一個(gè)TreeGridView(樹(shù)形表格)示例代碼

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;

namespace?TreeGridViewTestOnly
{
????public?partial?class?Form1?:?Form
????{
????????public?List?personList?=?new?List();
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//首先生成數(shù)據(jù)
????????????this.GenerateData();
????????????//然后生成列
????????????this.GenerateClo();

????????}
????????///?
????????///?生成數(shù)據(jù)
????????///?

????????private?void?GenerateData()?{
????????????for?(int?i?=?0;?i?????????????{
????????????????Person?p1?=?new?Person()?{?Id?=?i?Password?=?“密碼“?+?i?Level?=?1?};
????????????????for?(int?j?=?0;?j?????????????????{
????????????????????Person?p2?=?new?Person()?{?Id?=?j?Password?=?“密碼“?+?j?Level?=?2?};
????????????????????for?(int?k?=?0;?k?????????????????????{
????????????????????????Person?p3?=?new?Person()?{?Id?=?k?Password?=?“密碼“?+?k?Level?=?3?};
????????????????????????if?(p2.ChildList?==?null)
????????????????????????{
????????????????????????????p2.ChildList?=?new?List();
????????????????????????}
????????????????????????p2.ChildList.Add(p3);
????????????????????}
????????????????????if?(p1.ChildList?==?null)
????????????????????{
????????????????????????p1.ChildList?=?new?List();
????????????????????}
????????????????????p1.ChildList.Add(p2);
????????????????}
????????????????personList.Add(p1);
????????????}
????????}

????????///?
????????///?生成列
????????///?

????????private?void?GenerateClo()
????????{
????????????this.dataGridView1.ReadOnly?=?true;
????????????this.dataGridView1.AllowUserToAddRows?=?false;
????????????this.dataGridView1.AllowUserToDeleteRows?=?false;
????????????this.dataGridView1.AllowUserToOrderColumns?=?false;
????????????this.dataGridView1.AllowUserToResizeRows?=?false;
????????????this.dataGridView1.AllowUserToResizeColumns?=?false;

????????????#region?影響性能

????????????this.dataGridView1.ColumnHeadersHeightSizeMode?=?DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
????????????this.dataGridView1.RowHeadersWidthSizeMode?=?DataGridViewRowHeadersWidthSizeMode.DisableResizing;

????????????this.dataGridView1.AutoSizeColumnsMode?=?DataGridViewAutoSizeColumnsMode.None;
????????????this.dataGridView1.AutoSizeRowsMode?=?DataGridViewAutoSizeRowsMode.None;

????????????#endregion

????????????this.dataGridView1.CellBorderstyle?=?DataGridViewCellBorderstyle.None;
????????????//this.dataGridView1.EditMode?=?DataGridViewEditMode.EditProgrammatically;
????????????this.dataGridView1.RowHeadersVisible?=?false;
????????????this.dataGridView1.SelectionMode?=?DataGridViewSelectionMode.FullRowSelect;

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2019-08-22?10:42??TreeGridViewTestOnly\
?????目錄???????????0??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\
?????文件?????????187??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\App.config
?????文件????????3740??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\Form1.Designer.cs
?????文件????????8955??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\Form1.cs
?????文件????????6181??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\Form1.resx
?????文件????????1016??2019-08-22?10:43??TreeGridViewTestOnly\TreeGridViewTestOnly\Person.cs
?????文件?????????532??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Program.cs
?????目錄???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\
?????文件????????1364??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\AssemblyInfo.cs
?????文件????????2892??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\Resources.Designer.cs
?????文件????????5612??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\Resources.resx
?????文件????????1107??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\Settings.Designer.cs
?????文件?????????249??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\Properties\Settings.settings
?????文件????????3857??2019-08-22?10:53??TreeGridViewTestOnly\TreeGridViewTestOnly\TreeGridViewTestOnly.csproj
?????目錄???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\
?????目錄???????????0??2019-08-22?10:53??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\
?????文件???????14336??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.exe
?????文件?????????187??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.exe.config
?????文件???????36352??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.pdb
?????文件???????24224??2019-08-22?13:37??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.vshost.exe
?????文件?????????187??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.vshost.exe.config
?????文件?????????490??2012-06-06?02:06??TreeGridViewTestOnly\TreeGridViewTestOnly\bin\Debug\TreeGridViewTestOnly.vshost.exe.manifest
?????目錄???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\
?????目錄???????????0??2019-08-22?13:32??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\
?????文件????????1453??2019-08-22?13:30??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????7047??2019-08-22?10:43??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2019-08-22?13:38??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\TempPE\
?????文件???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件???????????0??2019-08-22?10:42??TreeGridViewTestOnly\TreeGridViewTestOnly\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
............此處省略9個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源