我有一个dataTreeListView
作为添加到它如下这已经得到了当场打死列标题:ObjectListView重新排序列
oCol2.IsVisible = false;
dataTreeListView.AllColumns.AddRange(new OLVColumn[] { oCol1, oCol2, oCol3, oCol4, oCol5});
dataTreeListView.KeyAspectName = id;
dataTreeListView.ParentKeyAspectName = ParentId;
dataTreeListView.DataSource = list;
dataTreeListView.RootKeyValue = 0;
名单本身已经得到了7种性质(包括Id
和ParentId
)。
我试图实现的是,在selectedIndex
更改组合框时,列标题将改变位置。
From View (type1) (oCol2.IsVisible = false):
oCol1 (expandable) | oCol2 (hidden) | oCol3 | oCol4 | oCol5
To View (type2) (oCol2.IsVisible = true):
oCol2 | oCol1 (expandable) | oCol3 | oCol4 | oCol5
我现在得到的是视图(TYPE1)工作正常,但切换到查看TYPE2后,可扩展柱仍处于oCol1而不是oCol2。看来,我不能switch
的主要栏目。
对此有何帮助?
的2型视图,然后再oCol1(可扩展)定义oCol2。根据你的问题,这看起来像一个预期的输出。除非我错过任何东西。 –
嗨theghostofc,我试图做这样的事情。 dataTreeListView.AllColumns.Clear(); oCol2.IsVisible = true; dataTreeListView.AllColumns.AddRange(new OLVColumn [] {oCol2,oCol1,oCol3,oCol4,oCol5,}); 结果仍然是一样的,第一列的oCol1 – user3167398